Skip to content

Commit

Permalink
Implement button click confirmation toast for split button and reduce…
Browse files Browse the repository at this point in the history
… its width (#5769)
  • Loading branch information
deleonio authored Dec 13, 2023
2 parents c24474e + 69f9d56 commit 1ba5795
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions packages/samples/react/src/components/split-button/basic.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,24 @@
import { ToasterService } from '@public-ui/components';
import React, { FC } from 'react';
import { KolSplitButton } from '@public-ui/react';

const toaster = ToasterService.getInstance(document);

export const SplitButtonBasic: FC = () => {
const handleButtonClick = () => {
void toaster.enqueue({
description: 'The Button has been clicked.',
label: `Button Clicked`,
type: 'info',
});
};

return (
<div className="grid gap-4">
<KolSplitButton _label="Nur der Pfeil öffnet" _on={{ onClick: console.log }}>
<KolSplitButton _label="Nur der Pfeil öffnet" className="w-200px" _on={{ onClick: handleButtonClick }}>
Drowndown-Inhalt
</KolSplitButton>
<KolSplitButton _label="ohne label" _hide-label _icons="codicon codicon-git-pull-request">
<KolSplitButton _label="ohne label" _hide-label _icons="codicon codicon-git-pull-request" className="w-200px">
Drowndown-Inhalt
</KolSplitButton>
</div>
Expand Down

0 comments on commit 1ba5795

Please sign in to comment.