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

RainbowButton

rainbow-button

Animates a multicolor border around a prominent action button.

Usage

Basic usage

The background color is a flowing rainbow gradient (take chart-1..4 token, switch with the light and dark theme), with a blurred halo at the bottom.

tsx
<RainbowButton>Get Started</RainbowButton>

Flow speed

speed Controls the duration of one round of rainbow translation. The smaller it is, the faster it flows.

tsx
<RainbowButton speed="2s">Rapid</RainbowButton>
<RainbowButton speed="5s">Soothing</RainbowButton>

When to use

Use RainbowButton for a highly prominent hero CTA with flowing chart colors and a blurred halo. Use Button for ordinary actions, ShimmerButton for one animated edge highlight, or PulsatingButton for an expanding pulse.

Import

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

Props

NameTypeDefaultDescription
size"sm" | "md" | "lg""md"Size step, on the same 32/40/48px scale as Button.
speedstring3sDuration of one rainbow animation cycle.
...buttonPropsComponentPropsWithoutRef<"button">-Native button props.

Events

EventTypeDescription
onClick(e: MouseEvent<HTMLButtonElement>) => voidClick callback, transparently transmitted via ComponentPropsWithoutRef<"button">

Slots

SlotTypeDescription
childrenReactNodeButton copy, transparently transmitted through the native button attribute
renderReactElementCustom rendered element, such as <a> or Next.js <Link>; button styles and the bottom glow layer are merged into it.

Example

tsx
<RainbowButton>Get Started</RainbowButton>

// Slower animation
<RainbowButton speed="5s">Get Started</RainbowButton>

// A landing-page CTA is often a link: render swaps the tag, the rainbow and glow stay
<RainbowButton render={<Link href="/pricing" />}>See pricing</RainbowButton>

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).
  • 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 · ShimmerButton · PulsatingButton · RippleButton · ButtonGroup · SocialButton

Playground

<RainbowButton speed="3s">Get Started</RainbowButton>
PreviousInteractiveHoverButtonFormsNextPulsatingButton

On this page

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