3.4.0 • Published 5 months ago

@cieloazul310/gatsby-theme-aoi-components v3.4.0

Weekly downloads
-
License
ISC
Repository
github
Last release
5 months ago

@cieloazul310/gatsby-theme-aoi-components

A components libary for @cieloazul310/gatsby-theme-aoi built with MUI

npm version

Import

import { AppLink } from '@cieloazul310/gatsby-theme-aoi';

Components

<AppLink>

Gatsby Link + MUI Link

Example Code

<AppLink to="/page-2/">
  Go to Page 2
</AppLink>

Props

MUI Link Props
https://mui.com/api/link/)

@reach/router Link Props
https://reach.tech/router/api/Link

<AppLinkButton>

Gatsby Link + MUI Button

Example Code

<AppLinkButton to="/page-2/" variant="contained" color="primary">
  Go to Page 2
</AppLinkButton>

Props

MUI Button Props
https://mui.com/api/button/

@reach/router Link Props
https://reach.tech/router/api/Link

<BottomNavigationAppLink>

Gatsby Link + MUI BottomNavigationAction

Example Code

import BottomNavigation from '@mui/material/BottomNavigation';
import { BottomNavigationAppLink, usePathnameWithoutPrefix } from '@cieloazul310/gatsby-theme-aoi';

function BottomNav() {
  const pathname = usePathnameWithoutPrefix();
  return (
    <BottomNavigation 
      value={pathname}
      showLabels
    >
      <BottomNavigationAppLink
       value="/"
       label="Home"
       icon={<HomeIcon />} 
      />
      <BottomNavigationAppLink
       value="/page-2/" 
       label="Page 2"
       icon={<PersonIcon />}
      />
    </BottomNavigation>
  );
}

Props

MUI BottomNavigationAction Props
https://mui.com/api/bottom-navigation-action/

NOTE: Gatsby Link's to prop is same to value prop.

Source: https://github.com/cieloazul310/gatsby-aoi/blob/main/packages/gatsby-theme-aoi-components/src/AppLink.tsx


<Article>

For article

Props

NameTypeDefault
childrenReact.ReactNode
maxWidthstring'sm'

&
MUI Container Props
https://mui.com/api/container/

<ArticleTitle>

<h2>

Props

MUI Typography Props
https://mui.com/api/typography/

<Paragraph>

equivalent to:
<Typography variant="body1" paragraph>

Props

MUI Typography Props
https://mui.com/api/typography/

<SubParagraph>

equivalent to:
<Typography variant="body2" paragraph>

Props

MUI Typography Props
https://mui.com/api/typography/

<H3>

<h3> for Gatsby Theme Aoi

Props

MUI Typography Props
https://mui.com/api/typography/

<H4>

<h4> for Gatsby Theme Aoi

Props

MUI Typography Props
https://mui.com/api/typography/

<H5>

<h5> for Gatsby Theme Aoi

Props

MUI Typography Props
https://mui.com/api/typography/

<H6>

<h6> for Gatsby Theme Aoi

Props

MUI Typography Props
https://mui.com/api/typography/

<Blockquote>

<blockquote> for Gatsby Theme Aoi

Props

MUI Typography Props
https://mui.com/api/typography/

<Hr>

MUI Divider with margin-top and margin-bottom

<InlineCode>

<code> for Gatsby Theme Aoi

Props

MUI Typography Props
https://mui.com/api/typography/

<Ul>

<ul> for Gatsby Theme Aoi

Props

MUI Typography Props
https://mui.com/api/typography/

<Ol>

<ol> for Gatsby Theme Aoi

Props

MUI Typography Props
https://mui.com/api/typography/

<Li>

<li> for Gatsby Theme Aoi

Props

MUI Typography Props
https://mui.com/api/typography/

<Alert>

Simplified MUI <Alert>

Props

nametypedefault
titlestringundefiend

&
MUI Alert Props
https://mui.com/api/alert/

Example Code

<Alert severity="error" title="Error">
  Error message hoge hoge hoge.
</Alert>

<Alert severity="success">
  Success message hoge hoge hoge.
</Alert>

Source: https://github.com/cieloazul310/gatsby-aoi/blob/main/packages/gatsby-theme-aoi-components/src/Article.tsx


<ExternalLink>

MUI Link with target="_blank" rel="noopener noreferrer"

Example Code

<ExternalLink href="https://www.mito-hollyhock.net/">
  Link
</ExternalLink>

Source: https://github.com/cieloazul310/gatsby-aoi/blob/main/packages/gatsby-theme-aoi-components/src/ExternalLink.tsx


<Jumbotron>

Jumbotorn like Bootstrap

Example Code

// with title
<Jumbotron title="Vamos" maxWidth="md" />

// with children
<Jumbotron maxWidth="md">
  <Typography variant="body2">Type</Typography>
  <Typography variant="h5" component="h2" gutterBottom>
    Title
  </Typography>
  <Button variant="contained">
    Getting Started
  </Button>
</Jumbotron>

Props

nameTypeDefault
children?React.ReactNodeundefined
title?stringundefined
maxWidth?Breakpointsundefined
height?numberundefined
bgColor?stringundefined
bgImage?stringundefined
gradient?booleanundefined

Source: https://github.com/cieloazul310/gatsby-aoi/blob/main/packages/gatsby-theme-aoi-components/src/Jumbotron.tsx


<ListItemAppLink>

Gatsby Link + MUI ListItem

Example Code

<List>
  <ListItemAppLink to="/page-2/">
    <ListItemIcon>
      <PersonIcon>
    </ListItemIcon>
    <ListItemText primary="Page 2" />
  </ListItemAppLink>
</List>

Props

MUI ListItem Props
https://mui.com/api/list-item/

@reach/router Link Props
https://reach.tech/router/api/Link

Source: https://github.com/cieloazul310/gatsby-aoi/blob/main/packages/gatsby-theme-aoi-components/src/ListItemAppLink.tsx


<ListItemLink>

Gatsby Link を装飾した Gatsby Theme Aoi 独自のコンポーネント。 xs size: Button, sm size ListItemprimaryText がリンクになる。

Example Code

<List>
  <ListItemLink to="/page-2/" primaryText="Page-2" />
</List>

Props

nametypedefaultdescription
tostringRequried
color?string'inherit'MUI Link Color
primaryTextstringRequried
secondaryText?stringundefined
button?booleanundefined'xs' では常に true
inset?booleanfalse
avatar?React.ReactNodeundefined
secondaryAction?React.ReactNodeundefined

Source: https://github.com/cieloazul310/gatsby-aoi/blob/main/packages/gatsby-theme-aoi-components/src/ListItemLink.tsx


<ListItemToggleDarkMode>

MUI ListItem@cieloazul310/gatsby-theme-aoi-top-layout のダークモード切り替えのスイッチを組み込んだコンポーネント

Props

nametypedefault
label?string'Dark Mode'

<ListItemToggleUseSystemTheme>

MUI ListItem@cieloazul310/gatsby-theme-aoi-top-layout のシステムテーマ利用の切り替えのスイッチを組み込んだコンポーネント

Props

nametypedefault
label?string'Auto Dark Mode'

Example Code

<List>
  <ListItemToggleDarkMode label="ダークモード" />
  <ListItemUseSystemTheme label="システムテーマ" />
</List>

Source: https://github.com/cieloazul310/gatsby-aoi/blob/main/packages/gatsby-theme-aoi-components/src/ListItemToggleDarkMode.tsx


<Section>

background.paper の背景色を持った <div> コンポーネント

<SectionDivider>

<Section> コンポーネントを区切るための空の <div> 要素。<Section> 要素より少し暗い背景色を持つ。

NOTE: Material-UI v4 以前は background.defaultbackground.paper より暗く、空の <div> 要素を置くことでレイアウトにアクセントを付けられた。

Example Code

<Layout title="Page Title">
  <Jumbotron title="Example" />
  <SectionDivider />
  <Section>
    <Article>
      {...article}
    </Article>
  </Section>
  <SectionDivider />
  <Section>
    <Article>
      {...footer}
    </Article>
  </Section>
</Layout>

Source: https://github.com/cieloazul310/gatsby-aoi/blob/main/packages/gatsby-theme-aoi-components/src/Section.tsx


<SocialIcon>

MUI Icon にソーシャルアイコンを設定したコンポーネント

Props

nameType
name'email' | 'twitter' | 'facebook' | 'github' | 'instagram' | 'youtube' | 'linkedin' | string

&
IconProps: https://mui.com/api/icon/

<SocialLink>

<SocialIcon> に外部リンクを設定したコンポーネント

Props

nameType
name'email' | 'twitter' | 'facebook' | 'github' | 'instagram' | 'youtube' | 'linkedin' | string
urlstring

&
IconProps: https://mui.com/api/icon/

Example Code

const { socials } = useSiteMetadata();

return (
  <div>
    {social.map(({ name, url }, index) => (
      <SocialLink key={index.toString()} name={name} url={url} />
    ))}
  </div>
);

Source: https://github.com/cieloazul310/gatsby-aoi/blob/main/packages/gatsby-theme-aoi-components/src/Socials.tsx


<TabPane>

Gatsby Theme Aoi のためのタブの枠コンポーネント

Example

import Tabs from '@mui/material/Tabs';
import Tab from '@mui/material/Tab';

function Page() {
  const [tab, setTab] = React.useState(0);
  const handleTab = (event: React.SyntheticEvent, newValue: number) => {
    setTab(newValue);
  };
  const handleTabIndex = (index: number) => () => {
    setTab(index);
  };
  return (
    <Layout
      tabs={
        <Tabs value={tab} onChange={handleTab}>
          <Tab label="Tab1" />
          <Tab label="Tab2" />
          <Tab label="Tab3" />
        </Tabs>
      }
    >
      <TabPane index={0} currentTab={tab}>
        {...children}
      </TabPane>
      <TabPane index={1} currentTab={tab}>
        {...children}
      </TabPane>
      <TabPane index={2} currentTab={tab}>
        {...children}
      </TabPane>
    </Layout>
  );
}

Props

nametypedefault
currentTabnumberRequried
indexnumberRequried
childrenReact.ReactNodeRequried
renderNeightbor?booleanfalse

Gatsby Theme Aoi packages

References

3.4.0

5 months ago

3.3.0

6 months ago

3.2.2

1 year ago

3.2.1

1 year ago

3.2.0

1 year ago

3.1.1

1 year ago

3.1.0

1 year ago

3.0.1

1 year ago

3.2.3

1 year ago

3.0.0

1 year ago

2.11.0

1 year ago

2.10.1

1 year ago

3.0.0-alpha.6

2 years ago

3.0.0-alpha.1

2 years ago

3.0.0-alpha.0

2 years ago

3.0.0-alpha.3

2 years ago

3.0.0-alpha.2

2 years ago

2.9.0

1 year ago

3.0.0-alpha.4

2 years ago

2.9.1

1 year ago

2.9.3

1 year ago

2.4.1

2 years ago

2.4.0

2 years ago

2.4.2

2 years ago

2.1.5

2 years ago

2.1.2

2 years ago

2.1.1

2 years ago

1.7.1

2 years ago

1.3.5

2 years ago

1.7.0

2 years ago

1.6.1

2 years ago

1.3.4

2 years ago

1.6.0

2 years ago

1.3.3

2 years ago

1.5.0

2 years ago

1.3.2

2 years ago

1.4.0

2 years ago

1.3.1

2 years ago

1.3.0

2 years ago

2.1.0

2 years ago

2.0.0

2 years ago

2.0.0-0

3 years ago