@startupjs-ui/toast 0.1.12 → 0.1.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/README.mdx +29 -2
  3. package/package.json +7 -7
package/CHANGELOG.md CHANGED
@@ -3,6 +3,22 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [0.1.16](https://github.com/startupjs/startupjs-ui/compare/v0.1.15...v0.1.16) (2026-02-10)
7
+
8
+ **Note:** Version bump only for package @startupjs-ui/toast
9
+
10
+
11
+
12
+
13
+
14
+ ## [0.1.13](https://github.com/startupjs/startupjs-ui/compare/v0.1.12...v0.1.13) (2026-02-03)
15
+
16
+ **Note:** Version bump only for package @startupjs-ui/toast
17
+
18
+
19
+
20
+
21
+
6
22
  ## [0.1.12](https://github.com/startupjs/startupjs-ui/compare/v0.1.11...v0.1.12) (2026-01-21)
7
23
 
8
24
  **Note:** Version bump only for package @startupjs-ui/toast
package/README.mdx CHANGED
@@ -14,7 +14,7 @@ import './index.mdx.cssx.styl'
14
14
 
15
15
  # Toast
16
16
 
17
- Toast provides brief non-blocking notifications that inform users of a process that an app has performed or will perform.
17
+ Toast displays brief, non-blocking notifications that inform the user about actions the app has performed or will perform. Toasts appear at the top of the screen and automatically dismiss after 5 seconds unless marked as an alert.
18
18
 
19
19
  ```js
20
20
  import { ToastProvider, toast } from 'startupjs-ui'
@@ -22,7 +22,7 @@ import { ToastProvider, toast } from 'startupjs-ui'
22
22
 
23
23
  ## Installation
24
24
 
25
- Render `ToastProvider` once inside `Portal.Provider` before your page context (for example, `Stack`).
25
+ Render the `ToastProvider` component once inside a `Portal.Provider`, before your page content (for example, a navigation `Stack`).
26
26
 
27
27
  ```jsx
28
28
  import { Portal, ToastProvider, DialogsProvider } from 'startupjs-ui'
@@ -43,6 +43,8 @@ export default function RootLayout () {
43
43
 
44
44
  ## Simple example
45
45
 
46
+ Call the `toast()` function to show a notification. At minimum, pass a `text` property.
47
+
46
48
  ```jsx example
47
49
  function onPress () {
48
50
  toast({ text: 'Note archived' })
@@ -53,6 +55,31 @@ return pug`
53
55
  `
54
56
  ```
55
57
 
58
+ ## Toast types
59
+
60
+ The `type` option controls the visual style and default icon/title of the toast. Available types are `'info'` (default), `'success'`, `'warning'`, and `'error'`.
61
+
62
+ ## Alert mode
63
+
64
+ By default, toasts auto-dismiss after 5 seconds. Set `alert` to `true` to keep the toast visible until the user manually closes it.
65
+
66
+ ## Action button
67
+
68
+ Pass `onAction` to display an action button on the toast. The button label defaults to `'View'` and can be customized with `actionLabel`. The toast is automatically closed after the action is triggered.
69
+
70
+ ## `toast()` options
71
+
72
+ | Option | Type | Default | Description |
73
+ |---|---|---|---|
74
+ | `type` | `'info' \| 'error' \| 'warning' \| 'success'` | `'info'` | Visual style variant -- determines the color, icon, and default title |
75
+ | `title` | `string` | Based on `type` | Title text displayed in the header (defaults to `'Info'`, `'Error'`, `'Warning'`, or `'Success'`) |
76
+ | `text` | `string` | | Body text displayed below the title |
77
+ | `icon` | `IconProps['icon']` | Based on `type` | Custom icon shown next to the title |
78
+ | `alert` | `boolean` | `false` | When `true`, prevents the toast from auto-closing after 5 seconds |
79
+ | `actionLabel` | `string` | `'View'` | Label for the action button |
80
+ | `onAction` | `() => void` | | Handler called when the action button is pressed |
81
+ | `onClose` | `() => void` | | Called after the toast is closed and removed from the stack |
82
+
56
83
  ## Sandbox
57
84
 
58
85
  ### toast
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@startupjs-ui/toast",
3
- "version": "0.1.12",
3
+ "version": "0.1.16",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -8,17 +8,17 @@
8
8
  "types": "index.d.ts",
9
9
  "type": "module",
10
10
  "dependencies": {
11
- "@startupjs-ui/button": "^0.1.12",
11
+ "@startupjs-ui/button": "^0.1.16",
12
12
  "@startupjs-ui/core": "^0.1.11",
13
- "@startupjs-ui/div": "^0.1.12",
14
- "@startupjs-ui/icon": "^0.1.11",
15
- "@startupjs-ui/portal": "^0.1.11",
16
- "@startupjs-ui/span": "^0.1.12"
13
+ "@startupjs-ui/div": "^0.1.16",
14
+ "@startupjs-ui/icon": "^0.1.16",
15
+ "@startupjs-ui/portal": "^0.1.16",
16
+ "@startupjs-ui/span": "^0.1.16"
17
17
  },
18
18
  "peerDependencies": {
19
19
  "react": "*",
20
20
  "react-native": "*",
21
21
  "startupjs": "*"
22
22
  },
23
- "gitHead": "c0b4606437077bb6d170e2c0b16b674801c304fe"
23
+ "gitHead": "9943aa3566d5d80f5b404473906eb3c0611f9ee5"
24
24
  }