66- ** ` AwesomeButtonProgress ` ** — progress flow wrapper on top of ` AwesomeButton `
77- ** ` AwesomeButtonSocial ` ** — social/share wrapper on top of ` AwesomeButton `
88
9- This README is updated for the current v8 build outputs (including theme CSS + theme module mappings).
9+ This README is updated for the current ` 8.1.0 ` release outputs (including theme CSS + theme module mappings).
1010
1111---
1212
@@ -196,6 +196,29 @@ export default function Example() {
196196}
197197```
198198
199+ ### Text transition (string labels only)
200+
201+ Use ` textTransition ` when the button label is a plain string and you want label changes to animate.
202+
203+ ``` jsx
204+ import React from ' react' ;
205+ import { AwesomeButton } from ' @rcaferati/react-awesome-button' ;
206+ import ' @rcaferati/react-awesome-button/styles.css' ;
207+
208+ export default function Example () {
209+ const [expanded , setExpanded ] = React .useState (false );
210+
211+ return (
212+ < AwesomeButton
213+ type= " primary"
214+ textTransition
215+ onPress= {() => setExpanded ((value ) => ! value)}>
216+ {expanded ? ' Processing settlement report' : ' Generate report' }
217+ < / AwesomeButton>
218+ );
219+ }
220+ ```
221+
199222---
200223
201224## ` AwesomeButton ` Props
@@ -208,6 +231,7 @@ export default function Example() {
208231| ` disabled ` | ` boolean ` | ` false ` | Disables interactions |
209232| ` visible ` | ` boolean ` | ` true ` | Toggles visible state class |
210233| ` placeholder ` | ` boolean ` | ` false ` | If ` true ` and ` children ` is empty, renders placeholder/disabled state |
234+ | ` textTransition ` | ` boolean ` | ` false ` | Animates string-only label changes with a scrambling transition |
211235| ` between ` | ` boolean ` | ` false ` | Uses ` space-between ` layout for content (useful with icons) |
212236| ` ripple ` | ` boolean ` | ` false ` | Enables ripple effect on successful press release |
213237| ` moveEvents ` | ` boolean ` | ` true ` | Enables pointer move position classes (` left/middle/right ` ) |
@@ -291,6 +315,36 @@ export default function Example() {
291315}
292316```
293317
318+ ### Spinner/text-only mode and custom bar timing
319+
320+ Use ` showProgressBar={false} ` to keep the loading/result text flow while hiding the dark loading bar.
321+ Use ` progressLoadingTime ` to control how long the progress bar takes to advance during the loading phase.
322+
323+ ``` jsx
324+ import React from ' react' ;
325+ import { AwesomeButtonProgress } from ' @rcaferati/react-awesome-button' ;
326+ import ' @rcaferati/react-awesome-button/styles.css' ;
327+
328+ const sleep = (ms ) => new Promise ((resolve ) => setTimeout (resolve, ms));
329+
330+ export default function Example () {
331+ return (
332+ < AwesomeButtonProgress
333+ type= " primary"
334+ loadingLabel= " Syncing…"
335+ resultLabel= " Synced!"
336+ showProgressBar= {false }
337+ progressLoadingTime= {1500 }
338+ onPress= {async (_event , next ) => {
339+ await sleep (900 );
340+ next (true );
341+ }}>
342+ Sync account
343+ < / AwesomeButtonProgress>
344+ );
345+ }
346+ ```
347+
294348### With icon (` before ` )
295349
296350``` jsx
@@ -325,12 +379,14 @@ export default function Example() {
325379
326380> ` AwesomeButtonProgress ` accepts all ` AwesomeButton ` props ** except** ` active ` and replaces ` onPress ` with the progress version below.
327381
328- | Prop | Type | Default | Description |
329- | -------------- | ----------------------- | ------------ | ------------------------------------------------------------ |
330- | ` onPress ` | ` (event, next) => void ` | ` null ` | Progress handler. Call ` next(true) ` or ` next(false, label?) ` |
331- | ` loadingLabel ` | ` string ` | ` 'Wait…' ` | Loading phase label |
332- | ` resultLabel ` | ` string ` | ` 'Success!' ` | Success label |
333- | ` releaseDelay ` | ` number ` | ` 500 ` | Delay before reset after progress end |
382+ | Prop | Type | Default | Description |
383+ | --------------------- | ----------------------- | ------------ | ------------------------------------------------------------------------- |
384+ | ` onPress ` | ` (event, next) => void ` | ` null ` | Progress handler. Call ` next(true) ` or ` next(false, label?) ` |
385+ | ` loadingLabel ` | ` string ` | ` 'Wait…' ` | Loading phase label |
386+ | ` resultLabel ` | ` string ` | ` 'Success!' ` | Success label |
387+ | ` releaseDelay ` | ` number ` | ` 500 ` | Delay before reset after progress end |
388+ | ` showProgressBar ` | ` boolean ` | ` true ` | Hides the dark loading bar when ` false ` , while keeping the progress flow |
389+ | ` progressLoadingTime ` | ` number ` | ` 6000 ` | Loading-phase progress bar duration in milliseconds |
334390
335391---
336392
0 commit comments