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

PulsatingButton

pulsating-button

Emphasizes an action with a configurable pulse ring around the button.

Usage

Basic usage

primary The background color expands and fades out to form a pulse halo, suitable for guiding the user's attention to key actions (subscription/registration).

tsx
<PulsatingButton>Subscribe now</PulsatingButton>

Pulse speed

duration Controls the duration of one round of pulses. The smaller the pulse, the more rapid it is.

tsx
<PulsatingButton duration="1s">hurried</PulsatingButton>
<PulsatingButton duration="2.5s">Smooth</PulsatingButton>

Customized halo color

pulseColor specifies the pulse halo color, which defaults to 70% of primary.

tsx
<PulsatingButton pulseColor="var(--color-danger)">Live broadcast</PulsatingButton>

When to use

Use PulsatingButton for a CTA that needs extra emphasis through an expanding halo, such as Subscribe or Submit. Use Button for ordinary actions, ShimmerButton for an animated edge highlight, or RainbowButton for a multicolor flowing background.

Import

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

Props

NameTypeDefaultDescription
size"sm" | "md" | "lg""md"Size step, on the same 32/40/48px scale as Button.
pulseColorstring70% of var(--color-primary)Halo color.
durationstring1.5sDuration of one pulse 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 pulsing halo are merged into it.

Example

tsx
<PulsatingButton>Subscribe now</PulsatingButton>

// Slower pulse
<PulsatingButton duration="2.5s">Subscribe now</PulsatingButton>

// When the CTA is a link, render swaps the tag and the halo stays
<PulsatingButton render={<Link href="/signup" />}>Sign up</PulsatingButton>

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 · RainbowButton · RippleButton · ButtonGroup · SocialButton

Playground

<PulsatingButton duration="1.5s">Subscribe now</PulsatingButton>
PreviousRainbowButtonFormsNextRippleButton

On this page

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