Skip to content

Commit

Permalink
EuiCopy
Browse files Browse the repository at this point in the history
  • Loading branch information
cee-chen committed Jan 12, 2024
1 parent 588fa65 commit 8c5b3a1
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions src/components/copy/copy.stories.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/

import React from 'react';
import type { Meta, StoryObj } from '@storybook/react';

import { EuiButton } from '../button';

import { EuiCopy, EuiCopyProps } from './copy';

const meta: Meta<EuiCopyProps> = {
title: 'EuiCopy',
component: EuiCopy,
argTypes: {
afterMessage: { control: 'text' },
beforeMessage: { control: 'text' },
},
args: {
// Component defaults
afterMessage: 'Copied',
},
};

export default meta;
type Story = StoryObj<EuiCopyProps>;

export const Playground: Story = {
args: {
textToCopy: 'Hello world',
children: (copy) => <EuiButton onClick={copy}>Click to copy</EuiButton>,
},
};

0 comments on commit 8c5b3a1

Please sign in to comment.