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
@@ -202,6 +202,29 @@ export default function Example() {
202202}
203203```
204204
205+ ### Text transition (string labels only)
206+
207+ Use ` textTransition ` when the button label is a plain string and you want label changes to animate.
208+
209+ ``` jsx
210+ import React from ' react' ;
211+ import { AwesomeButton } from ' @rcaferati/react-awesome-button' ;
212+ import ' @rcaferati/react-awesome-button/styles.css' ;
213+
214+ export default function Example () {
215+ const [expanded , setExpanded ] = React .useState (false );
216+
217+ return (
218+ < AwesomeButton
219+ type= " primary"
220+ textTransition
221+ onPress= {() => setExpanded ((value ) => ! value)}>
222+ {expanded ? ' Processing settlement report' : ' Generate report' }
223+ < / AwesomeButton>
224+ );
225+ }
226+ ```
227+
205228---
206229
207230## ` AwesomeButton ` Props
@@ -214,6 +237,7 @@ export default function Example() {
214237| ` disabled ` | ` boolean ` | ` false ` | Disables interactions |
215238| ` visible ` | ` boolean ` | ` true ` | Toggles visible state class |
216239| ` placeholder ` | ` boolean ` | ` false ` | If ` true ` and ` children ` is empty, renders placeholder/disabled state |
240+ | ` textTransition ` | ` boolean ` | ` false ` | Animates string-only label changes with a scrambling transition |
217241| ` between ` | ` boolean ` | ` false ` | Uses ` space-between ` layout for content (useful with icons) |
218242| ` ripple ` | ` boolean ` | ` false ` | Enables ripple effect on successful press release |
219243| ` moveEvents ` | ` boolean ` | ` true ` | Enables pointer move position classes (` left/middle/right ` ) |
@@ -297,6 +321,36 @@ export default function Example() {
297321}
298322```
299323
324+ ### Spinner/text-only mode and custom bar timing
325+
326+ Use ` showProgressBar={false} ` to keep the loading/result text flow while hiding the dark loading bar.
327+ Use ` progressLoadingTime ` to control how long the progress bar takes to advance during the loading phase.
328+
329+ ``` jsx
330+ import React from ' react' ;
331+ import { AwesomeButtonProgress } from ' @rcaferati/react-awesome-button' ;
332+ import ' @rcaferati/react-awesome-button/styles.css' ;
333+
334+ const sleep = (ms ) => new Promise ((resolve ) => setTimeout (resolve, ms));
335+
336+ export default function Example () {
337+ return (
338+ < AwesomeButtonProgress
339+ type= " primary"
340+ loadingLabel= " Syncing…"
341+ resultLabel= " Synced!"
342+ showProgressBar= {false }
343+ progressLoadingTime= {1500 }
344+ onPress= {async (_event , next ) => {
345+ await sleep (900 );
346+ next (true );
347+ }}>
348+ Sync account
349+ < / AwesomeButtonProgress>
350+ );
351+ }
352+ ```
353+
300354### With icon (` before ` )
301355
302356``` jsx
@@ -331,12 +385,14 @@ export default function Example() {
331385
332386> ` AwesomeButtonProgress ` accepts all ` AwesomeButton ` props ** except** ` active ` and replaces ` onPress ` with the progress version below.
333387
334- | Prop | Type | Default | Description |
335- | -------------- | ----------------------- | ------------ | ------------------------------------------------------------ |
336- | ` onPress ` | ` (event, next) => void ` | ` null ` | Progress handler. Call ` next(true) ` or ` next(false, label?) ` |
337- | ` loadingLabel ` | ` string ` | ` 'Wait…' ` | Loading phase label |
338- | ` resultLabel ` | ` string ` | ` 'Success!' ` | Success label |
339- | ` releaseDelay ` | ` number ` | ` 500 ` | Delay before reset after progress end |
388+ | Prop | Type | Default | Description |
389+ | --------------------- | ----------------------- | ------------ | ------------------------------------------------------------------------- |
390+ | ` onPress ` | ` (event, next) => void ` | ` null ` | Progress handler. Call ` next(true) ` or ` next(false, label?) ` |
391+ | ` loadingLabel ` | ` string ` | ` 'Wait…' ` | Loading phase label |
392+ | ` resultLabel ` | ` string ` | ` 'Success!' ` | Success label |
393+ | ` releaseDelay ` | ` number ` | ` 500 ` | Delay before reset after progress end |
394+ | ` showProgressBar ` | ` boolean ` | ` true ` | Hides the dark loading bar when ` false ` , while keeping the progress flow |
395+ | ` progressLoadingTime ` | ` number ` | ` 6000 ` | Loading-phase progress bar duration in milliseconds |
340396
341397---
342398
0 commit comments