Hulian UIv0.93.5413 components0 components
  • Start
  • Components
  • Blocks
  • Pages
  • Demos
  • Changelog
ChineseEnglish
  • ComponentsComponents
  • ThemeTheme

Buttons

  • Button
  • ShimmerButton
  • InteractiveHoverButton
  • RainbowButton
  • PulsatingButton
  • RippleButton
  • ButtonGroup
  • SocialButton

Basic Inputs

  • Input
  • Textarea
  • CellEditor
  • Select
  • Checkbox
  • CheckboxGroup
  • Radio
  • Switch
  • Toggle
  • Segmented
  • Slider
  • NumberField
  • ElasticSlider

Advanced Inputs

  • MathTextarea
  • QuestionEditor
  • QuestionAnswer
  • MathField
  • SecretField
  • PasswordGenerator
  • Combobox
  • RemoteSelect
  • Listbox
  • Mentions
  • InputOTP
  • Rating
  • Upload
  • RegionSelect
  • ImageCropper
  • ScopeMatrix
  • Transfer
  • Cascader
  • TreeSelect
  • RegionCascader
  • CountrySelect
  • MarkdownEditor
  • Novel editor
  • RichTextEditor
  • CodeEditor
  • IssueReporter
  • ColorPicker
  • ColorField
  • ColorSwatchPicker
  • Choicebox
  • EmojiPicker
  • VoiceRecord
  • IconPicker
  • InspectorPanel

Date and Time

  • Calendar
  • DatePicker
  • DateTimePicker
  • DateRangePicker
  • TimePicker
  • TimeField

Form Frameworks

  • Form
  • ModalForm / DrawerForm
  • ProForm
  • StepsForm
  • LoginForm
  • AuthPanel
  • ClickCaptcha
  • Label
  • Field
  • SearchForm

ShimmerButton

shimmer-button

Adds a moving shimmer treatment to a call-to-action button.

Usage

Basic usage

Default primary background color, with a circle of high-gloss sparkles on the edge, suitable for the first screen owner CTA.

tsx
<ShimmerButton>Start using Hulian</ShimmerButton>

Customized background color

background can be changed to any color (including token), and the spark color defaults to primary-foreground.

tsx
<ShimmerButton background="var(--color-danger)">Delete account</ShimmerButton>

Spark Speed

shimmerDuration Controls the duration of a round of spark wandering, the smaller the faster it is.

tsx
<ShimmerButton shimmerDuration="2s">Rapid</ShimmerButton>
<ShimmerButton shimmerDuration="5s">Soothing</ShimmerButton>

When to use

Use ShimmerButton for a primary CTA that needs a moving highlight around its edge. Use Button for ordinary actions, RainbowButton for a flowing multicolor background, or PulsatingButton for an expanding halo.

Import

ts
import { ShimmerButton } from "@hulianui/ui"

Props

NameTypeDefaultDescription
size"sm" | "md" | "lg""md"Size step, on the same 32/40/48px scale as Button.
shimmerColorstringfollows foregroundShimmer highlight color; defaults to --hulian-shimmer-fg (i.e. foreground).
shimmerSizestring0.05emShimmer width.
borderRadiusstringvar(--hl-radius-control, var(--radius))Button border radius. Follows the control radius token.
shimmerDurationstring3sDuration of one shimmer cycle.
backgroundstringvar(--color-primary)Button background color.
foregroundstringvar(--color-primary-foreground)Text color (#288), paired with background: by default both follow the theme; when you pass a fixed background (a brand gradient that ignores the theme) pair it with a fixed foreground, or dark mode renders near-black text on the gradient. Lands in --hulian-shimmer-fg; the shimmer color reads it by default.
...buttonPropsComponentPropsWithoutRef<"button">-Native button attributes passed to the rendered element.

Events

EventTypeDescription
onClick(e: MouseEvent<HTMLButtonElement>) => voidNative click handler.

Slots

SlotTypeDescription
childrenReactNodeButton content.
renderReactElementCustom rendered element, such as <a> or Next.js <Link>; button styles and shimmer structure are merged into it.

Example

tsx
<ShimmerButton>Get started with Hulian</ShimmerButton>

// Change the background color
<ShimmerButton background="var(--color-danger)" foreground="var(--color-danger-foreground)">Delete</ShimmerButton>
// Fixed brand gradient (ignores the theme): fix the foreground too, or dark mode turns primary-foreground near-black on the purple gradient
<ShimmerButton background="linear-gradient(135deg,#7c3aed,#4f46e5)" foreground="#fff">Get started</ShimmerButton>

Usage guidelines

  • Shares its base with Button. Layout, the three size steps (32/40/48px tall), the focus ring, the disabled treatment, and forwardRef all come from the same EFFECT_BUTTON_BASE_CLASS and BUTTON_SIZE_CLASS. Colour and corner radius are deliberately not shared, since the background is this component's own effect layer. As a result it lines up with regular Buttons and matches the library-wide focus style; before 0.27.0 each effect button rolled its own markup, lacked all of the above, and sized itself with px-6 py-3, so a toolbar row came out uneven (#126).
  • Pass theme-token CSS variables such as var(--color-danger) to color props so they adapt with the theme; avoid hard-coded color values.
  • Tailwind Preflight applies svg { display: block }, which can split a custom icon and label. See [[tailwind-preflight-svg-block-breaks-icon-text-in-nonflex-button]] and make the content wrapper inline-flex.

Related

Button · RainbowButton · PulsatingButton · RippleButton · ButtonGroup · SocialButton

Playground

<ShimmerButton shimmerDuration="3s">Get started</ShimmerButton>
PreviousButtonFormsNextInteractiveHoverButton

On this page

  • Usage
  • Documentation
    • When to use
    • Import
    • Props
    • Events
    • Slots
    • Example
    • Usage guidelines
    • Related
  • Playground