Skip to content

Commit 40d8a52

Browse files
authored
Add more usage examples for bar visualizer (#1116)
1 parent 0c30d15 commit 40d8a52

File tree

2 files changed

+32
-0
lines changed

2 files changed

+32
-0
lines changed

.changeset/forty-birds-repair.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@livekit/components-react": patch
3+
---
4+
5+
Add more usage examples for bar visualizer

packages/react/src/components/participant/BarVisualizer.tsx

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,33 @@ const getSequencerInterval = (
7676
* );
7777
* }
7878
* ```
79+
*
80+
* @example
81+
* Styling the BarVisualizer using CSS classes
82+
* ```css
83+
* .lk-audio-bar {
84+
* // Styles for "idle" bars
85+
* }
86+
* .lk-audio-bar.lk-highlighted {
87+
* // Styles for "active" bars
88+
* }
89+
* ```
90+
*
91+
* @example
92+
* Styling the BarVisualizer using CSS custom properties
93+
* ```css
94+
* --lk-fg // for the "active" colour, note that this defines the main foreground colour for the whole "theme"
95+
* --lk-va-bg // for "idle" colour
96+
* ```
97+
*
98+
* @example
99+
* Using a custom bar template for the BarVisualizer
100+
* ```tsx
101+
* <BarVisualizer>
102+
* <div className="all the classes" />
103+
* </BarVisualizer>
104+
* ```
105+
* the highlighted children will get a data prop of data-lk-highlighted for them to switch between active and idle bars in their own template bar
79106
*/
80107
export const BarVisualizer = /* @__PURE__ */ React.forwardRef<HTMLDivElement, BarVisualizerProps>(
81108
function BarVisualizer(

0 commit comments

Comments
 (0)