Shimmer button
The Button with a light sweep across it. Still a native button.
SourceStyles source@monoline/react 0.5.0Markdown for AI toolsstable
- Built on radix-ui/Slot
- Native <button>: Enter and Space activate, Tab focuses; behaviour comes from Button.
- The sweep is a pseudo-element, never read aloud, and is off under prefers-reduced-motion.
- Styles in one file:
02-buttons.css
Import
import '@monoline/css';
import {ShimmerButton} from '@monoline/react';
Not installed yet? Pick a route.
Copies the source and its styles into your project.
npx monoline add shimmer-button
It needs radix-ui; install it if your project does not have it:
npm install radix-ui
Usage
import {ShimmerButton} from '@monoline/react';
<ShimmerButton>Start free trial</ShimmerButton>
Examples
Solid
Line
Data Attributes
State is exposed through attributes. Style it with these selectors, not with class toggles.
This component sets no state attributes.
CSS classes
| Class | Stylesheet |
|---|---|
.btn | 02-buttons.css |
.btn-block | 02-buttons.css |
.btn-danger | 02-buttons.css |
.btn-ghost | 02-buttons.css |
.btn-lg | 02-buttons.css |
.btn-line | 02-buttons.css |
.btn-sm | 02-buttons.css |
.btn-solid | 02-buttons.css |
.skeleton | 13-loading.css |
.skeleton-block | 13-loading.css |
.skeleton-hatch | 13-loading.css |
.spinner | 13-loading.css |
.shimmer-button | shimmer-button.css |
Customization
Style it with the kit's tokens in your own CSS, loaded after @monoline/css. Prefer the attributes above over extra classes. See Theming for every token.
app.css
.btn {
border-color: var(--accent);
}
Accessibility
- Native <button>: Enter and Space activate, Tab focuses; behaviour comes from Button.
- The sweep is a pseudo-element, never read aloud, and is off under prefers-reduced-motion.
Keyboard
| Keys | Action |
|---|---|
| Enter / Space | Activate |
| Tab | Focuses |