Temporary notification messages with ASCII styling and automatic dismissal.
npm install react-ascii-ui
import { AsciiToast } from 'react-ascii-ui'; export default function App() { const [showToast, setShowToast] = useState(false); return ( <div> <button onClick={() => setShowToast(true)}> Show Toast </button> <AsciiToast type="success" message="Operation completed successfully" duration={3000} isVisible={showToast} onClose={() => setShowToast(false)} position="bottom-right" /> </div> ); }
Prop | Type | Default | Description |
---|---|---|---|
message | string | - | Toast message text |
type | 'info' | 'success' | 'warning' | 'error' | 'info' | Toast type for styling |
duration | number | 4000 | Auto-dismiss duration (0 = no auto-dismiss) |
isVisible | boolean | - | Controls toast visibility |
onClose | () => void | undefined | Called when toast is closed |
position | 'top-right' | 'top-left' | 'bottom-right' | 'bottom-left' | 'top-center' | 'bottom-center' | 'bottom-right' | Toast position on screen |
showCloseButton | boolean | true | Show/hide close button |