tv-button
Version:
buttons for nuxtjs powered by tailwindcss
81 lines (64 loc) • 2.13 kB
Markdown
<p align="center">
<img src="media/buttons.gif" width="600" />
</p>
[](https://www.npmjs.com/package/tv-button)
[](https://nuxtjs.org)

[](https://www.npmjs.com/package/tv-button)
[](https://www.npmjs.com/package-tv-button)
<!-- [](https://discord.gg/enn4S6) -->
> This requires [Nuxt.js](https://nuxtjs.org) with the [Tailwind CSS](https://tailwindcss.nuxtjs.org) module
## Quick Setup
1. Add the `nuxt-tailvue` dependency to your Nuxt.js project
```bash
npm install nuxt-tailvue
# OR
yarn add nuxt-tailvue
```
2. Add `button` to the `modules` section of `nuxt.config.js`
```js
{
modules: [
['nuxt-tailvue', {button: true}],
]
}
```
3. If you're using [Purge](https://tailwindcss.com/docs/controlling-file-size), add this module to the content section of `tailwind.config.js`
```js
module.exports = {
content: [
'node_modules/tv-*/dist/tv-*.umd.min.js',
}
```
## Features
### ButtonGroup component
- Works with themes

```html
<ButtonGroup>
<PushButton group="left">
left
</PushButton>
<PushButton group="middle">
middle
</PushButton>
<PushButton group="right">
right
</PushButton>
</ButtonGroup>
```
### Combine with [tv-icon](https://github.com/acidjazz/tv-icon)

```html
<PushButton>
<IconCheck class="w-5 h-5 mr-2" primary="text-green-300" secondary="text-green-400"/>
Pair with Icons
</PushButton>
```
### Use as a nuxt-link
- Button turns into a [<nuxt-link>](https://nuxtjs.org/api/components-nuxt-link/) for proper navigation
```html
<PushButton to="/about">
About Us
</PushButton>
```