Sunday, 19 January 2020

NativeBase Accordion



import React from 'react';
import {
  Container, Header, Title, Content, Footer,
  FooterTab, Button, Left, Right, Body, Icon, Text,
  Accordion
} from 'native-base';

const dataArray = [
  { title: "First Element", content: "Lorem ipsum dolor sit amet" },
  { title: "Second Element", content: "Lorem ipsum dolor sit amet" },
  { title: "Third Element", content: "Lorem ipsum dolor sit amet" }
];

export default function App() {
  return (
    <Container>
      <Header>
        <Body>
          <Title>Accordion</Title>
        </Body>
      </Header>
      <Content padder>
        <Accordion dataArray={dataArray} icon="add" expandedIcon="remove"
          iconStyle={{ color: "green" }}
          expandedIconStyle={{ color: "red" }}
          headerStyle={{ backgroundColor: "#b7daf8" }}
          contentStyle={{ backgroundColor: "#ddecf8" }} />
      </Content>
    </Container>
  );
}

No comments:

Post a Comment