Last active
March 20, 2021 22:40
-
-
Save mkirby/0347293db3a95ac7f84f3a0091e0084e to your computer and use it in GitHub Desktop.
Step 3: How To Create A Semantic UI React Functional Table Component
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//create the table title and column names | |
//we're using both icons and text for column names! | |
//don't forget to import Icon from SUIR | |
import React from "react"; | |
import scenarios from "./scenarios.json"; | |
import { Table, Icon } from "semantic-ui-react"; | |
function ScenarioTable() { | |
return ( | |
<div className="scenario__table"> | |
<Table> | |
<Table.Header> | |
<Table.Row> | |
<Table.HeaderCell colSpan="5" textAlign="center"> | |
<h1>Scenarios</h1> | |
</Table.HeaderCell> | |
</Table.Row> | |
<Table.Row textAlign="center"> | |
<Table.HeaderCell>Id</Table.HeaderCell> | |
<Table.HeaderCell> | |
<Icon name="location arrow" /> | |
</Table.HeaderCell> | |
<Table.HeaderCell> | |
<Icon name="unlock" /> | |
</Table.HeaderCell> | |
<Table.HeaderCell> | |
<Icon name="check" /> | |
</Table.HeaderCell> | |
<Table.HeaderCell>Name</Table.HeaderCell> | |
</Table.Row> | |
</Table.Header> | |
<Table.Body> | |
{/* table data here */} | |
</Table.Body> | |
<Table.Footer> | |
{/* table controls here */} | |
</Table.Footer> | |
</Table> | |
</div> | |
); | |
} | |
export default ScenarioTable; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment