Skip to content

Commit

Permalink
Document <theoplayer-slot-container>
Browse files Browse the repository at this point in the history
  • Loading branch information
MattiasBuelens committed Mar 14, 2024
1 parent 7795d62 commit 267df87
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
1 change: 1 addition & 0 deletions react/src/components/SlotContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import * as React from 'react';
* See {@link @theoplayer/web-ui!SlotContainer | SlotContainer in @theoplayer/web-ui}.
*
* @group Components
* @internal
*/
export const SlotContainer = createComponent({
tagName: 'theoplayer-slot-container',
Expand Down
15 changes: 15 additions & 0 deletions src/components/SlotContainer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,21 @@ import slotContainerCss from './SlotContainer.css';

const template = createTemplate('theoplayer-slot-container', `<style>${slotContainerCss}</style><slot></slot>`);

/**
* `<theoplayer-slot-container>` - A container that can be assigned to a slot,
* and behaves as if all its children are directly assigned to that slot.
*
* This behaves approximately like a regular `<div>` with style `display: contents`,
* but receives some special treatment from e.g. {@link MenuGroup | `<theoplayer-menu-group>`}
* which normally expects its {@link Menu | menu}s to be slotted in as direct children.
* Those menus can also be children of a `<theoplayer-slot-container>` instead.
*
* This is an internal component, used mainly by Open Video UI for React.
* You shouldn't need this under normal circumstances.
*
* @group Components
* @internal
*/
export class SlotContainer extends HTMLElement {
constructor() {
super();
Expand Down

0 comments on commit 267df87

Please sign in to comment.