Button

A button, or a link styled as one with href. Submits or resets its form with type.

Source on GitHub

Variants × colors
primarygrayredteal filledButtonButtonButtonButton lightButtonButtonButtonButton outlineButtonButtonButtonButton subtleButtonButtonButtonButton defaultButton——— transparentButtonButtonButtonButton raisedButtonButtonButtonButton

default is the neutral surface and ignores color. Any palette name or CSS color works: color="#8e44ad".

Gradient
Theme gradient pink → orange Raw colors
Sizes
Extra small Small Medium Large Extra large
Radius
xs sm md lg full
Icons, states and links
New file Continue Saving Disabled Link
Full width
Long labels in narrow containers: drag the corner of the box
Another schedule (e.g. a different dose at weekends) Another schedule (e.g. a different dose at weekends)

A label longer than the room ends in an ellipsis; with wrap it breaks into lines.

Code

API

For AI agents: this API as Markdown, or every component in llms-full.txt.

<ray-button> · RayButton

PropertyAttributeTypeDefaultDescription
variantvariant reflectsfilled | light | outline | subtle | default | transparent | gradient | raisedfilledVisual style. raised: a physical key on a darker edge that sinks when pressed (mouse, touch or keyboard).
gradientgradient reflectsstringWith variant=gradient: "from to [deg]", palette colors or CSS colors ("teal blue 90"). Default: the --ray-gradient-* tokens.
colorcolorstringA palette color (blue, red…) or any CSS color. Default: the primary color.
sizesize reflectsstringsmHeight, padding and font size: xs…xl or any CSS length (the padding and the font follow).
radiusradiusxs | sm | md | lg | xl | fullCorner radius. Default: --ray-radius-default.
typetypebutton | submit | resetbuttonsubmit/reset act on the enclosing form.
disableddisabledbooleanNot interactive (also when inside a disabled fieldset).
loadingloadingbooleanShows a spinner over the content and blocks clicks.
fullWidthfull-widthbooleanTakes the whole width of its container.
wrapwrap reflectsbooleanA 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.
hrefhrefstringRenders a link instead of a button.
targettargetstringLink target, with href.
namenamestringWith type=submit: submitted as name=value.
valuevaluestringWith type=submit: the submitted value.
SlotDescription
(default)The label.
leftIcon or content before the label.
rightIcon or content after the label.
PartDescription
buttonThe inner <button> or <a>.
labelThe label wrapper.