Skip to content

Commit ce239e8

Browse files
committed
docs(banner): add README
1 parent 400cdc4 commit ce239e8

1 file changed

Lines changed: 51 additions & 0 deletions

File tree

elements/pf-v6-banner/README.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# pf-v6-banner
2+
3+
A full-width banner for communicating short, non-dismissible messages.
4+
5+
## Usage
6+
7+
### Default banner
8+
9+
```html
10+
<pf-v6-banner>Default banner</pf-v6-banner>
11+
```
12+
13+
### Status banner with screen reader text
14+
15+
```html
16+
<pf-v6-banner status="danger" screen-reader-text="Danger banner:">
17+
An error has occurred. Contact support for help.
18+
</pf-v6-banner>
19+
```
20+
21+
### Sticky color banner
22+
23+
```html
24+
<pf-v6-banner color="blue" sticky>
25+
This banner sticks to the top of its container.
26+
</pf-v6-banner>
27+
```
28+
29+
## Divergences from React `Banner`
30+
31+
### Changed API
32+
33+
| React prop | Web component | Difference |
34+
|---|---|---|
35+
| `isSticky` | `sticky` attribute | Renamed; dropped `is` prefix |
36+
| `color` + `status` mutual exclusion | Both accepted | React enforces via TypeScript union types (`color` and `status` cannot both be set). The web component accepts both; `status` takes visual precedence via CSS cascade. |
37+
38+
### Added
39+
40+
| Web component API | Notes |
41+
|---|---|
42+
| `--pf-v6-c-banner--BackgroundColor` | Override the default background color |
43+
| `--pf-v6-c-banner--Color` | Override the default text color |
44+
| `--pf-v6-c-banner--FontSize` | Override the font size |
45+
| `--pf-v6-c-banner--PaddingBlockStart` | Override the block padding |
46+
| `--pf-v6-c-banner--PaddingInlineStart` | Override the inline padding |
47+
| `--pf-v6-c-banner--BorderColor` | Override the border color (high-contrast mode) |
48+
| `--pf-v6-c-banner--BorderWidth` | Override the border width (high-contrast mode) |
49+
| `--pf-v6-c-banner--m-sticky--ZIndex` | Override the z-index when sticky |
50+
| `--pf-v6-c-banner--m-sticky--BoxShadow` | Override the box shadow when sticky |
51+
| Per-color/status CSS custom properties | Each color (e.g., `--pf-v6-c-banner--m-red--BackgroundColor`) and status variant has overridable background and text color properties |

0 commit comments

Comments
 (0)