import * as React from "react"; import * as System from "~/components/system"; import * as Constants from "~/common/constants"; import Group from "~/components/system/Group"; import SystemPage from "~/components/system/SystemPage"; import ViewSourceLink from "~/components/system/ViewSourceLink"; import CodeBlock from "~/components/system/CodeBlock"; const TAB_GROUP_TWO = [ { value: "1", label: "Capricorn" }, { value: "2", label: "Aquarius" }, ]; const TAB_GROUP_FOUR = [ { value: "1", label: "Capricorn" }, { value: "2", label: "Aquarius" }, { value: "3", label: "Pisces" }, { value: "4", label: "Aries" }, ]; export default class SystemPageCardTabs extends React.Component { state = { exampleOne: "1", exampleTwo: "4", }; _handleChange = (e) => { this.setState({ [e.target.name]: e.target.value }); }; render() { return ( Card Tabs

The CardTabGroup component is used to allow the users to switch between views.


Imports

Import React and the CardTabGroup Component.

{`import * as React from 'react'; import { CardTabGroup } from 'slate-react-system';`}

Usage

Define the tab group values and labels.
{`const TAB_GROUP_TWO = [ { value: '1', label: 'Capricorn' }, { value: '2', label: 'Aquarius' }, ]; const TAB_GROUP_FOUR = [ { value: '1', label: 'Capricorn' }, { value: '2', label: 'Aquarius' }, { value: '3', label: 'Pisces' }, { value: '4', label: 'Aries' }, ];`}
Declare the CardTabGroup component.
{`class ExampleOne extends React.Component { state = { exampleOne: '1' } _handleChange = e => this.setState( { [e.target.name]: e.target.value } ); render() { return( ) } } class ExampleTwo extends React.Component { state = { exampleTwo: '4' } _handleChange = e => this.setState( { [e.target.name]: e.target.value } ); render() { return( ) } }`}

Output






Accepted React Properties

onChange ), b: "function", c: "null", d: "Function called upon an onChange event", }, { id: 2, a: ( value ), b: "boolean", c: "false", d: "The value that is currently selected. Can be used to assign default values as well", }, { id: 3, a: ( options ), b: "Array", c: "[]", d: "An array of options, each of which has a value and a label", }, { id: 4, a: "name", b: "string", c: "null", d: "Input name", }, ], }} />
); } }