Skip to content

Commit

Permalink
Add simpler slotfill example
Browse files Browse the repository at this point in the history
  • Loading branch information
ciampo committed Jan 27, 2022
1 parent caac47f commit e15e9de
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion packages/components/src/utils/hooks/stories/use-cx.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const Example = ( { args, children } ) => {
return <span className={ classes }>{ children }</span>;
};

export const _slotfill = () => {
export const _slotFill = () => {
const { Fill, Slot } = createSlotFill( 'UseCxExampleSlot' );

const redText = css`
Expand Down Expand Up @@ -72,6 +72,27 @@ export const _slotfill = () => {
);
};

export const _slotFillSimple = () => {
const { Fill, Slot } = createSlotFill( 'UseCxExampleSlotTwo' );

const redText = css`
color: red;
`;

return (
<SlotFillProvider>
<Iframe>
<Fill name="test-slot">
<Example args={ [ redText ] }>
This text should be red
</Example>
</Fill>
</Iframe>
<Slot bubblesVirtually name="test-slot" />
</SlotFillProvider>
);
};

export const _default = () => {
const redText = css`
color: red;
Expand Down

0 comments on commit e15e9de

Please sign in to comment.