Button
Usage
Use the default slot to set the text of the Button.
{
"message": "You should use slots with <ContentRenderer>",
"value": {},
"excerpt": false,
"tag": "div"
}You can also use the label prop.
{
"message": "You should use slots with <ContentRenderer>",
"value": {},
"excerpt": false,
"tag": "div"
}Style
Use the color and variant props to change the visual style of the Button.
{
"message": "You should use slots with <ContentRenderer>",
"value": {},
"excerpt": false,
"tag": "div"
}Besides all the colors from the ui.colors object, you can also use the white, gray and black colors with their pre-defined variants.
White
{
"message": "You should use slots with <ContentRenderer>",
"value": {},
"excerpt": false,
"tag": "div"
}Gray
{
"message": "You should use slots with <ContentRenderer>",
"value": {},
"excerpt": false,
"tag": "div"
}Black
{
"message": "You should use slots with <ContentRenderer>",
"value": {},
"excerpt": false,
"tag": "div"
}Size
Use the size prop to change the size of the Button.
{
"message": "You should use slots with <ContentRenderer>",
"value": {},
"excerpt": false,
"tag": "div"
}Rounded
To customize the border radius of the Button, you can use the ui prop.
{
"message": "You should use slots with <ContentRenderer>",
"value": {},
"excerpt": false,
"tag": "div"
}ui prop.Icon
Use any icon from Iconify by setting the icon prop by using this pattern: i-{collection_name}-{icon_name}.
Use the leading and trailing props to set the icon position or the leading-icon and trailing-icon props to set a different icon for each position.
{
"message": "You should use slots with <ContentRenderer>",
"value": {},
"excerpt": false,
"tag": "div"
}The label as prop or slot is optional so you can use the Button as an icon-only button.
{
"message": "You should use slots with <ContentRenderer>",
"value": {},
"excerpt": false,
"tag": "div"
}Disabled
Use the disabled prop to disable the Button.
{
"message": "You should use slots with <ContentRenderer>",
"value": {},
"excerpt": false,
"tag": "div"
}Loading
Use the loading prop to show a loading icon and disable the Button.
Use the loading-icon prop to set a different icon or change it globally in ui.button.default.loadingIcon. Defaults to i-heroicons-arrow-path-20-solid.
{
"message": "You should use slots with <ContentRenderer>",
"value": {},
"excerpt": false,
"tag": "div"
}Block
Use the block prop to make the Button fill the width of its container.
{
"message": "You should use slots with <ContentRenderer>",
"value": {},
"excerpt": false,
"tag": "div"
}Link
Use the to prop to make the Button a link.
{
"message": "You should use slots with <ContentRenderer>",
"value": {},
"excerpt": false,
"tag": "div"
}You can also pass any property from the NuxtLink component such as target, exact, etc.
Padded
Use the padded prop to remove the padding of the Button.
{
"message": "You should use slots with <ContentRenderer>",
"value": {},
"excerpt": false,
"tag": "div"
}Square
Use the square prop to force the Button to have the same padding horizontally and vertically.
{
"message": "You should use slots with <ContentRenderer>",
"value": {},
"excerpt": false,
"tag": "div"
}Truncate
Use the truncate prop to truncate the label of the Button.
{
"message": "You should use slots with <ContentRenderer>",
"value": {},
"excerpt": false,
"tag": "div"
}Group
To stack buttons as a group, use the ButtonGroup component.
- To size all the buttons equally, pass the
sizeprop - To change the orientation of the buttons, set the
orientationprop tovertical - To adjust the rounded or the shadow around buttons, customize with
ui.buttonGroup.roundedorui.buttonGroup.shadow
{
"message": "You should use slots with <ContentRenderer>",
"value": {},
"excerpt": false,
"tag": "div"
}This can also work with an Input component for example:
{
"message": "You should use slots with <ContentRenderer>",
"value": {},
"excerpt": false,
"tag": "div"
}Slots
leading
Use the #leading slot to set the content of the leading icon.
{
"message": "You should use slots with <ContentRenderer>",
"value": {},
"excerpt": false,
"tag": "div"
}trailing
Use the #trailing slot to set the content of the trailing icon.
{
"message": "You should use slots with <ContentRenderer>",
"value": {},
"excerpt": false,
"tag": "div"
}Props
{}config.default.size"sm""2xs""xs""md""lg""xl""button"nullconfig.default.color"primary""white""gray""black""red""orange""amber""yellow""lime""green""emerald""teal""cyan""sky""blue""indigo""violet""purple""fuchsia""pink""rose"config.default.variant"link""solid""outline""soft""ghost"nullnullnullconfig.default.loadingIconfalsefalsefalsefalsefalsefalsefalsetrueConfig
{
"message": "You should use slots with <ContentRenderer>",
"value": {},
"excerpt": false,
"tag": "div"
}