Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Latest commit

History

History
History
56 lines (51 loc) 路 1.74 KB

File metadata and controls

56 lines (51 loc) 路 1.74 KB
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
import React from 'react';
import { renderToHtml } from '../../services';
import {
GuideSectionTypes,
} from '../../components';
import {
EuiCode,
EuiToggle,
EuiLink,
EuiCallOut,
} from '../../../../src/components';
import Toggle from './toggle';
const toggleSource = require('!!raw-loader!./toggle');
const toggleHtml = renderToHtml(Toggle);
export const ToggleExample = {
title: 'Toggle',
sections: [{
source: [{
type: GuideSectionTypes.JS,
code: toggleSource,
}, {
type: GuideSectionTypes.HTML,
code: toggleHtml,
}],
text: (
<div>
<p>
The <EuiCode>EuiToggle</EuiCode> component is a very simplified utility for creating
toggle-able elements. There is only an on/off (checked/unchecked) state. All this creates is
a visibly hidden input (checkbox or radio) overtop of the children provided.
</p>
<p>
By default, the children will be wrapped in a block element. To change the display you can
simply use one of the <EuiLink href="/#/utilities/css-utility-classes">utility classes</EuiLink>
like <EuiCode>.eui-displayInlineBlock</EuiCode>.
</p>
<EuiCallOut title="Accessibility">
<p>
This utility is just a helper component and comes with no inherit styles including
no <EuiCode>:hover</EuiCode> or <EuiCode>:focus</EuiCode> states. If you use this utility
directly, be sure to add these states. Otherwise, you may just want to utilize
the <EuiLink href="/#/navigation/button">EuiButtonToggle</EuiLink> component.
</p>
</EuiCallOut>
</div>
),
components: { EuiToggle },
demo: <Toggle />,
props: { EuiToggle },
}],
};
Morty Proxy This is a proxified and sanitized view of the page, visit original site.