Button

Examples

Variants

Dark Modern
import {ReactNode} from "react"
import {Button} from "@qui/react-vscode"
export default function Variants(): ReactNode {
return (
<div className="flex flex-col items-center gap-4">
<Button>Button</Button>
<Button variant="secondary">Secondary</Button>
<Button variant="outline">Outline</Button>
</div>
)
}

Icons

Dark Modern
import {ReactNode} from "react"
import {Button} from "@qui/react-vscode"
export default function Icons(): ReactNode {
return (
<div className="grid justify-center gap-4">
<Button endIcon="chevron-right">Button</Button>
</div>
)
}

Sizes

Dark Modern
import type {ReactElement} from "react"
import {Button} from "@qui/react-vscode"
export default function Size(): ReactElement {
return (
<div className="flex flex-col items-center gap-4">
<Button endIcon="plus">Button</Button>
<Button endIcon="plus" size="sm">
Button
</Button>
<Button endIcon="plus" size="xs">
Button
</Button>
</div>
)
}

Disabled

Dark Modern
import type {ReactElement} from "react"
import {Button} from "@qui/react-vscode"
export default function Disabled(): ReactElement {
return (
<div className="flex flex-col items-center gap-4">
<Button disabled>Button</Button>
<Button disabled variant="secondary">
Secondary
</Button>
<Button disabled variant="outline">
Outline
</Button>
</div>
)
}

API

ButtonProps

Name & DescriptionOption(s)Default
The component used for the root node. It can be a React component or element.
| ElementType
| ComponentType
'button'
React children prop.
ReactNode
If true, the component will not be interactive and will appear dimmed.
boolean
false
Icon positioned after the children. If supplied as a string, the vscode codicon will be applied. Supply as a ReactElement for additional customization.
| string
| ReactElement
The size of each button.
| 'md'
| 'sm'
| 'xs'
'md'
Icon positioned after the children. If supplied as a string, the vscode codicon will be applied. Supply as a ReactElement for additional customization.
| string
| ReactElement
The style variant of the button.
| 'primary'
| 'secondary'
| 'outline'
'primary'
Type
| ElementType
| ComponentType
Default
'button'
Description
The component used for the root node. It can be a React component or element.
Description
React children prop.
Type
boolean
Default
false
Description
If true, the component will not be interactive and will appear dimmed.
Type
| string
| ReactElement
Description
Icon positioned after the children. If supplied as a string, the vscode codicon will be applied. Supply as a ReactElement for additional customization.
Type
| 'md'
| 'sm'
| 'xs'
Default
'md'
Description
The size of each button.
Type
| string
| ReactElement
Description
Icon positioned after the children. If supplied as a string, the vscode codicon will be applied. Supply as a ReactElement for additional customization.
Type
| 'primary'
| 'secondary'
| 'outline'
Default
'primary'
Description
The style variant of the button.