Skip to content

Button ​

Last updated

Demo ​

button/demo.vue

Primary actions default to solid sky blue. Use accent with tone for brand emphasis; outline, soft and ghost styles support secondary actions. Success, warning and danger carry their semantic meanings.

Buttons and badges share green success, sun yellow warning and coral danger, with paired darker foreground tokens.

Brand entrance ​

Use variant="hero" size="xl" for a homepage or campaign's main entrance. It pairs a deep blue-to-cyan gradient with white text, a soft shadow and a 56px touch target. Both themes retain the deep ramp and white foreground; never substitute the brighter decorative sky gradient. Hover deepens the colors, focus adds a two-color ring, and reduced motion disables the lift.

Keep one hero action per section. Everyday save, confirm and navigation controls use primary or secondary variants. tone and appearance do not change the hero palette. The shared --ylf-hero-* tokens define its colors and shadows; applications may adapt their router behavior while reusing these tokens.

Registry ​

Copy Button and shared tokens into an application by URL through Registry distribution. Prefer @yunlefun/vue for centrally maintained foundations.

Emphasis ​

Accent/status variants accept appearance="solid", soft or outline, including the legacy aurora alias. Other variants retain their appearance. variant="soft" is brand blue; colored soft buttons use variant="accent" appearance="soft".

Props ​

PropDescriptionTypeDefault
variantVariantprimary | hero | accent | secondary | soft | ghost | success | warning | dangerprimary
toneAccent hue, only for accentblue | sun | cyan | coral | pink | greenblue
appearanceEmphasis for accent and status variantssolid | soft | outlinesolid
sizeSizesm | md | lg | xlmd
roundPill radiusbooleantrue
blockFull widthbooleanfalse
loadingLoading statebooleanfalse
disabledDisabledbooleanfalse
tagRendered tag, such as 'a'string'button'

Accent tone defaults to blue. Other variants keep brand/status meanings. Legacy aurora aliases accent.

Slots ​

NameDescription
defaultButton text
iconLeading icon

Events ​

NameDescription
clickClick event, suppressed when disabled or loading