Shine button
A hero action with independent light sweep, moving gradient perimeter and breathing glow.
npx @swipeui/cli add shine-buttonWhen to use it
- Emphasize one occasional hero action.
- Keep action work and success/failure feedback on the control.
When not to use it
- Animate a row of competing actions.
- Keep ambient work running on hidden or background screens.
Installation
Installs with a Pro licence
Everything on this page is public except the source. Founder pre-sale opens around 5 January 2027.
Usage
import { ShineButton, SHINE_BUTTON_PALETTE } from '@/components/swipeui/ui/shine-button';
<ShineButton
sheen
borderGlow
borderColors={SHINE_BUTTON_PALETTE.rainbow}
borderChase
borderWidth={2}
breathing={false}
onPress={startCreating}
>
Start creating
</ShineButton>;Examples
hero, effects, async. The app and public preview use the same content and variant names. Demo settings sit outside the component and outcome feedback stays on the action.
Settings
| Setting | Default | Behavior |
|---|---|---|
onPress | undefined | Action work; promise results stay on this control. |
onError | undefined | Reports failed work. |
minPending | 450 | Minimum pending visibility, milliseconds. |
resetAfter | 1800 | Result visibility before resetting, milliseconds. |
pendingLabel | 'Working' | Pending label. |
successLabel | 'Done' | Successful result label. |
failureLabel | 'Try again' | Retry action label after failure. |
sheen | true | Light sweep over the fill, independently switchable. |
borderGlow | true | Moving gradient along the perimeter. |
borderColors | fill, ink, fill | At least two nonempty gradient colors; use SHINE_BUTTON_PALETTE.rainbow or your own palette. |
borderChase | false | A short illuminated segment travels around the measured rounded perimeter; false draws the full ring. |
borderWidth | 1.5 | Positive finite stroke width in points, inset to avoid clipping. |
breathing | false | Slow external glow pulse. |
active | true | Explicit lifecycle pause for hidden/occluded routes. Viewport/background pauses are automatic. |
disabled | false | Stop ambient work while interaction is unavailable. |
motion | app feel | Shared feel; Reduce Motion holds a still frame. |
children | absent | The label. Strings are wrapped in Text; other nodes inherit the label colour. |
variant | 'solid' | How much the button stands out: solid, tinted (a soft wash of the tone), outline, ghost (no fill until pressed) or plain (text only). The 1.x names default, secondary and destructive still work as solid primary, neutral and destructive. |
tone | 'primary' for solid, tinted and plain; 'neutral' for outline and ghost | The colour family: primary, neutral, destructive or success. |
size | 'md' | The height: sm 36pt (with a 44pt touch target), md 44pt, lg 52pt. |
shape | 'preset' | preset follows your preset's control radius; pill is a capsule. |
block | false | Stretches the button to the full width of its container. |
leadingIcon | absent | Content before the label: a node, or a function that receives { color, size }. |
trailingIcon | absent | Content after the label, hidden during success/retry results: a node, or a function that receives { color, size }. |
trailingIconNudge | false | Slides the trailing icon a little forward while pressed, mirrored in right-to-left layouts. |
loading | false | Shows a spinner, reports busy and ignores taps. |
loadingLabel | absent | Label shown while loading; defaults to the children. |
loadingPlacement | center | Shared spinner placement; center holds the content footprint. |
labelMorph | 'fade' | How a changed text label arrives: fade (the new label rises in as the old one fades), characters (only the changed letters roll in) or none. The width springs to fit either way. |
highlight | true | A faint rim of light along the top edge of solid buttons. |
glow | false | A soft shadow in the tone's colour under solid buttons. |
pressEffect | 'both' | Feedback while pressed: both scales and washes the surface, scale, wash or none. Text-only buttons dim their label instead of washing. |
disabledStyle | 'muted' | How a disabled button looks: muted mutes its fill and label; dim halves its opacity. |
palette | BUTTON_PALETTE | Colours that belong to the button's material rather than the theme (the top highlight). |
haptics | true | Plays a light impact on press. |
className | absent | Classes merged over the style. |
textClassName | absent | Classes for the label text. |
style | absent | Style escape hatch for the container. |
accessibilityLabel | current label | Optional spoken-name override. |
testID | undefined | Root identifier; parts append suffixes. |
Composition and behavior
Use active for routes that are mounted but occluded. The perimeter derives from plain measured geometry; every animated effect uses shared motion values. minPending/resetAfter are content milliseconds. Source checks do not establish device frame rate or native appearance.
The demo opts into a rainbow chase; the default library perimeter remains tone-based. The painted breathing layer sits outside the clipped sweep and the measured ambient host cannot be flattened.
sheen, borderGlow and breathing are independent; active explicitly pauses an occluded route.
The shared ambient helper measures viewport visibility and pauses off screen, in the background and under Reduce Motion. Reduce Transparency drops perimeter and breathing glows.
Promise actions are locked through minimum pending visibility, then show success or retry for resetAfter.
API reference
Review gates
Founder app and existing pnpm-dev visual acceptance remains open. Native runtime, VoiceOver/TalkBack, haptics, motion, Dynamic Type, RTL and recordings remain pending founder-scheduled 7.9. Source, bundle and unit checks do not establish visual or native acceptance.
Behavior and gestures
- sheen, borderGlow and breathing are independent; active explicitly pauses an occluded route.
- The shared ambient helper measures viewport visibility and pauses off screen, in the background and under Reduce Motion. Reduce Transparency drops perimeter and breathing glows.
- Promise actions are locked through minimum pending visibility, then show success or retry for resetAfter.
- borderColors, borderChase and borderWidth independently customize the perimeter; the demo opts into a chasing rainbow. Trailing action icons hide during success and retry outcomes.
Accessibility
- Named controls expose unavailable, busy and selected/progress state where applicable. Decorative layers are excluded from interaction.
- Meaningful outcome/availability announcements are distinct from clocks and decorative effects. Native VoiceOver/TalkBack, Dynamic Type, RTL and touch evidence remain pending for 7.9.
Motion
- Uses the
press,morph,numberandambientmotion roles, so it follows your app's feel. Passmotionto tune this one instance. - Every decorative duration/spring comes from the shared role helpers. Content clocks remain independent of motion feel.
- Reduce Motion retains readable outcome/progress feedback. Native motion/performance review remains pending.
Performance
- No new package, network service, telemetry or proprietary source.
- Async results and content timers clean up or invalidate after unmount; UI animation values stay on the UI thread.
Notes for AI
- Use active for routes that are mounted but occluded. The perimeter derives from plain measured geometry; every animated effect uses shared motion values. minPending/resetAfter are content milliseconds. Source checks do not establish device frame rate or native appearance.
- Founder app/web acceptance and all native runtime, accessibility, haptics, motion and recordings remain pending for 7.9.
Compatibility
| Runs on | Supported |
|---|---|
| Expo SDK 57 | Yes |
| Expo SDK 58 | Yes |
| React Native CLI (with Expo modules) | Yes |
| Expo Go | Yes |
| iOS | Yes |
| Android | Yes |
This table describes API support and static bundle checks. Native runtime, device accessibility and bare Uniwind compatibility remain pending.