Button
A button, or a link styled as one with href. Submits or resets its form with type.
Variants × colors
primarygrayredteal
filledButton Button Button Button
lightButton Button Button Button
outlineButton Button Button Button
subtleButton Button Button Button
defaultButton ———
transparentButton Button Button Button
raisedButton Button Button Button
default is the neutral surface and ignores color. Any palette name or CSS color works: color="#8e44ad".
Gradient
Sizes
Radius
Icons, states and links
Long labels in narrow containers: drag the corner of the box
A label longer than the room ends in an ellipsis; with wrap it breaks into lines.
API
For AI agents: this API as Markdown, or every component in llms-full.txt.
<ray-button> · RayButton
| Property | Attribute | Type | Default | Description |
|---|---|---|---|---|
variant | variant reflects | filled | light | outline | subtle | default | transparent | gradient | raised | filled | Visual style. raised: a physical key on a darker edge that sinks when pressed (mouse, touch or keyboard). |
gradient | gradient reflects | string | With variant=gradient: "from to [deg]", palette colors or CSS colors ("teal blue 90"). Default: the --ray-gradient-* tokens. | |
color | color | string | A palette color (blue, red…) or any CSS color. Default: the primary color. | |
size | size reflects | string | sm | Height, padding and font size: xs…xl or any CSS length (the padding and the font follow). |
radius | radius | xs | sm | md | lg | xl | full | Corner radius. Default: --ray-radius-default. | |
type | type | button | submit | reset | button | submit/reset act on the enclosing form. |
disabled | disabled | boolean | Not interactive (also when inside a disabled fieldset). | |
loading | loading | boolean | Shows a spinner over the content and blocks clicks. | |
fullWidth | full-width | boolean | Takes the whole width of its container. | |
wrap | wrap reflects | boolean | A long label breaks into lines and the button grows from its height (min-height: the size's height). Without it, a label longer than the room ends in an ellipsis. | |
href | href | string | Renders a link instead of a button. | |
target | target | string | Link target, with href. | |
name | name | string | With type=submit: submitted as name=value. | |
value | value | string | With type=submit: the submitted value. |
| Slot | Description |
|---|---|
| (default) | The label. |
left | Icon or content before the label. |
right | Icon or content after the label. |
| Part | Description |
|---|---|
button | The inner <button> or <a>. |
label | The label wrapper. |