├── .gitignore ├── .prettierignore ├── .prettierrc ├── LICENSE ├── README.md ├── _components ├── alert │ ├── AlertBasic.js │ └── index.mdx ├── auth │ ├── AuthBasic.js │ ├── AuthSocialProviders.js │ ├── OnlyAuthSocialProviders.js │ └── index.mdx ├── badge │ ├── BadgeBasic.js │ ├── BadgeDot.js │ └── index.mdx ├── button │ ├── ButtonBasic.js │ ├── ButtonBlock.js │ ├── ButtonIcons.js │ ├── ButtonSizes.js │ ├── ButtonTypes.js │ └── index.mdx ├── card │ ├── CardBasic.js │ ├── CardCover.js │ ├── CardHoverable.js │ ├── CardMeta.js │ └── index.mdx ├── checkbox │ ├── CheckboxBasic.js │ ├── CheckboxControlled.js │ ├── CheckboxGrouped.js │ └── index.mdx ├── dropdown │ ├── DropdownBasic.js │ ├── DropdownCheckbox.js │ ├── DropdownDoNotClose.js │ ├── DropdownPlacement.js │ ├── DropdownRadio.js │ └── index.mdx ├── icon │ ├── IconBasic.js │ ├── IconSize.js │ ├── IconStroke.js │ └── index.mdx ├── input │ ├── InputBasic.js │ ├── InputControls.js │ ├── InputCopy.js │ ├── InputError.js │ ├── InputIcon.js │ ├── InputLabels.js │ ├── InputReveal.js │ ├── InputTextArea.js │ ├── InputTextAreaWithLimit.js │ └── index.mdx ├── inputnumber │ ├── InputNumberBasic.js │ ├── InputNumberMinMax.js │ └── index.mdx ├── menu │ ├── MenuActiveState.js │ ├── MenuBasic.js │ ├── MenuWithGroups.js │ └── index.mdx ├── modal │ ├── ModalBasic.js │ ├── ModalCloseButton.js │ ├── ModalFooterBackground.js │ ├── ModalFooterCustom.js │ ├── ModalFooterCustomVertical.js │ ├── ModalFooterCustomVerticalOneButton.js │ ├── ModalFooterHide.js │ ├── ModalFooterRightAligned.js │ ├── ModalIcon.js │ ├── ModalVertical.js │ └── index.mdx ├── radio │ ├── RadioBasic.js │ ├── RadioControlled.js │ ├── RadioGrouped.js │ ├── RadioGroupedCards.js │ └── index.mdx ├── select │ ├── SelectBasic.js │ ├── SelectControlled.js │ ├── SelectError.js │ ├── SelectIcon.js │ ├── SelectOptionGroup.js │ └── index.mdx ├── sidepanel │ ├── SidePanelBasic.js │ ├── SidePanelFooterCustom.js │ ├── SidePanelFooterHide.js │ ├── SidePanelFooterLeftAligned.js │ ├── SidePanelLeftAligned.js │ ├── SidePanelWide.js │ └── index.mdx ├── tabs │ ├── TabsAddOnBefore.js │ ├── TabsBasic.js │ ├── TabsBlock.js │ ├── TabsIcon.js │ ├── TabsScrollable.js │ ├── TabsSize.js │ ├── TabsUnderline.js │ └── index.mdx └── typography │ ├── TypographyText.js │ ├── TypographyTitles.js │ └── index.mdx ├── _posts ├── Introduction.mdx └── License.mdx ├── components ├── CodeBlock │ ├── CodeBlock.module.css │ └── CodeBlock.tsx ├── CodeSample.tsx ├── ComponentIndex.tsx ├── ComponentProps.tsx ├── DefaultLayout.tsx ├── Header.tsx ├── Heading.tsx └── Nav.tsx ├── data ├── CodeEditorTheme.js ├── Menu.json └── spec.json ├── jsconfig.json ├── lib ├── fetchWrapper.ts ├── helpers.tsx └── posts.tsx ├── next-env.d.ts ├── next.config.js ├── package-lock.json ├── package.json ├── pages ├── _app.tsx ├── components │ └── [slug].tsx ├── index.tsx └── license.tsx ├── postcss.config.js ├── public ├── favicon.ico ├── fonts │ └── custom │ │ ├── CustomFont-Black.woff │ │ ├── CustomFont-Black.woff2 │ │ ├── CustomFont-BlackItalic.woff │ │ ├── CustomFont-BlackItalic.woff2 │ │ ├── CustomFont-Bold.woff │ │ ├── CustomFont-Bold.woff2 │ │ ├── CustomFont-BoldItalic.woff │ │ ├── CustomFont-BoldItalic.woff2 │ │ ├── CustomFont-Book.woff │ │ ├── CustomFont-Book.woff2 │ │ ├── CustomFont-BookItalic.woff │ │ ├── CustomFont-BookItalic.woff2 │ │ ├── CustomFont-Medium.woff │ │ └── CustomFont-Medium.woff2 ├── images │ ├── button.svg │ ├── logo-dark.png │ └── logo-light.png ├── og.jpg └── vercel.svg ├── styles ├── Home.module.css ├── globals.css └── index.css ├── tailwind.config.js └── tsconfig.json /.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | /.pnp 6 | .pnp.js 7 | 8 | # testing 9 | /coverage 10 | 11 | # next.js 12 | /.next/ 13 | /out/ 14 | 15 | # production 16 | /build 17 | 18 | # misc 19 | .DS_Store 20 | *.pem 21 | 22 | # debug 23 | npm-debug.log* 24 | yarn-debug.log* 25 | yarn-error.log* 26 | 27 | # local env files 28 | .env.local 29 | .env.development.local 30 | .env.test.local 31 | .env.production.local 32 | 33 | # vercel 34 | .vercel 35 | -------------------------------------------------------------------------------- /.prettierignore: -------------------------------------------------------------------------------- 1 | .expo 2 | .next 3 | node_modules 4 | package-lock.json 5 | docker* -------------------------------------------------------------------------------- /.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "trailingComma": "es5", 3 | "tabWidth": 2, 4 | "semi": false, 5 | "singleQuote": true, 6 | "printWidth": 100, 7 | "svelteSortOrder" : "styles-scripts-markup", 8 | "svelteStrictMode": true, 9 | "svelteBracketNewLine": true, 10 | "svelteAllowShorthand": false 11 | } -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright [yyyy] [name of copyright owner] 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Supabase UI Website 2 | 3 | --- 4 | 5 | Supabase UI is being deprecated. 6 | We are moving the components to the main mono repo at [github.com/supabase/supabase](http://github.com/supabase/supabase). 7 | 8 | This website will probably be removed/taken down in preference for a storybook documentation site. 9 | 10 | The auth component has been moved to it's own repo and package. [github.com/supabase-community/auth-ui](https://github.com/supabase-community/auth-ui). You can also read the docs for auth ui here. 11 | 12 | --- 13 | 14 | An open source UI component library inspired by Tailwind and AntDesign. 15 | 16 | ## Vision 17 | 18 | We have compiled repetitive UI patterns into components that we use across the Supabase suite of apps and examples. This library gives us a consistent brand, and accelerates our development/prototyping. 19 | 20 | We know there is already a large supply of UI libraries available online. This library is primarily to serve Supabase, but we hope that it can also be beneficial for apps that are built with Supabase. 21 | 22 | For example, we provide full components (like Auth widgets), which you can simply drop into your website. 23 | 24 | Over time, this library will expand to include a broader range of components and customization. By that stage we hope it will be beneficial even to developers outside of the Supabase ecosystem. 25 | 26 | ## Key Features 27 | 28 | ### Tailwind friendly 29 | 30 | We have compiled a group of aesthetically pleasing components with design inspiration from existing UI libraries and Tailwind UI examples. 31 | 32 | We try to allow Tailwind CSS classes be used for animations and we strongly encourage you to use a Tailwind config with Supabase UI. 33 | 34 | ### Open source 35 | 36 | Supabase UI is open source, and MIT licensed (fully permissive). 37 | 38 | Supabase UI uses libraries which are also permissively licensed, if they are lightweight, modular, and active. This is better for the ecosystem, rather than doing everything ourselves. These libraries include: 39 | 40 | - [Tailwind CSS](https://tailwindcss.com/) 41 | - [Feather Icons](https://feathericons.com/) 42 | - Libraries which handle design patterns like context menus, toast messages and interactive tables. 43 | -------------------------------------------------------------------------------- /_components/alert/AlertBasic.js: -------------------------------------------------------------------------------- 1 | import { Alert } from "@supabase/ui"; 2 | 3 | export default function AlertBasic() { 4 | return ( 5 | 6 | Hello adsda sdasd sadasdsad aads dd saad sddas dasdas dasd adasdd 7 | 8 | ); 9 | } 10 | -------------------------------------------------------------------------------- /_components/alert/index.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: Alert 3 | description: Basic button component 4 | img: '/images/button.svg' 5 | --- 6 | 7 | ## Installing 8 | 9 | Install the component 10 | 11 | ```cli 12 | npm install @supabase/ui 13 | ``` 14 | 15 | ## Getting started 16 | 17 | Import the component 18 | 19 | ```js 20 | import { Alert } from '@supabase/ui' 21 | ``` 22 | 23 | ## Basic 24 | 25 | 26 | -------------------------------------------------------------------------------- /_components/auth/AuthBasic.js: -------------------------------------------------------------------------------- 1 | import { Auth, Typography, Button } from '@supabase/ui' 2 | import { createClient } from '@supabase/supabase-js' 3 | 4 | const supabase = createClient('https://your-project-url.supabase.co', 'PROJECT_ANON_KEY') 5 | 6 | const Container = (props) => { 7 | const { user } = Auth.useUser() 8 | if (user) 9 | return ( 10 | <> 11 | Signed in: {user.email} 12 | 15 | 16 | ) 17 | return props.children 18 | } 19 | 20 | export default function AuthBasic() { 21 | return ( 22 | 23 | 24 | 25 | 26 | 27 | ) 28 | } 29 | -------------------------------------------------------------------------------- /_components/auth/AuthSocialProviders.js: -------------------------------------------------------------------------------- 1 | import { Auth, Typography, Button } from '@supabase/ui' 2 | import { createClient } from '@supabase/supabase-js' 3 | 4 | const supabase = createClient('https://your-project-url.supabase.co', 'PROJECT_ANON_KEY') 5 | 6 | const Container = (props) => { 7 | const { user } = Auth.useUser() 8 | if (user) 9 | return ( 10 | <> 11 | Signed in: {user.email} 12 | 15 | 16 | ) 17 | return props.children 18 | } 19 | 20 | export default function AuthBasic() { 21 | return ( 22 | 23 | 24 | 25 | 26 | 27 | ) 28 | } 29 | -------------------------------------------------------------------------------- /_components/auth/OnlyAuthSocialProviders.js: -------------------------------------------------------------------------------- 1 | import { Auth, Typography, Button } from '@supabase/ui' 2 | import { createClient } from '@supabase/supabase-js' 3 | 4 | const supabase = createClient('https://your-project-url.supabase.co', 'PROJECT_ANON_KEY') 5 | 6 | const Container = (props) => { 7 | const { user } = Auth.useUser() 8 | if (user) 9 | return ( 10 | <> 11 | Signed in: {user.email} 12 | 15 | 16 | ) 17 | return props.children 18 | } 19 | 20 | export default function AuthBasic() { 21 | return ( 22 | 23 | 24 | 25 | 26 | 27 | ) 28 | } 29 | -------------------------------------------------------------------------------- /_components/auth/index.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: Auth 3 | description: Authentication components 4 | img: '/images/button.svg' 5 | --- 6 | 7 | ## Installing 8 | 9 | Install the component 10 | 11 | ```cli 12 | npm install @supabase/ui 13 | ``` 14 | 15 | ## Getting started 16 | 17 | Import the component 18 | 19 | ```js 20 | import { Auth } from '@supabase/ui' 21 | ``` 22 | 23 | A community maintained Svelte version of this Auth component is also available: 24 | [joshnuss/supabase-ui-svelte](https://github.com/joshnuss/supabase-ui-svelte) 25 | 26 | ## Basic 27 | 28 | 29 | 30 | ## Social providers 31 | 32 | 33 | 34 | ## Only Thirdparty Social providers 35 | 36 | 37 | 38 | ## Props 39 | 40 | ##### Auth 41 | 42 | 43 | 44 | ##### Auth.UserContextProvider 45 | 46 | Coming soon 47 | -------------------------------------------------------------------------------- /_components/badge/BadgeBasic.js: -------------------------------------------------------------------------------- 1 | import { Badge } from "@supabase/ui"; 2 | 3 | export default function BadgeBasic() { 4 | return ( 5 | <> 6 | blue 7 | gray 8 | green 9 | indigo 10 | pink 11 | purple 12 | red 13 | yellow 14 | 15 | large 16 | small 17 | 18 | ); 19 | } 20 | -------------------------------------------------------------------------------- /_components/badge/BadgeDot.js: -------------------------------------------------------------------------------- 1 | import { Badge } from "@supabase/ui"; 2 | 3 | export default function BadgeDot() { 4 | return With dot; 5 | } 6 | -------------------------------------------------------------------------------- /_components/badge/index.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: Badge 3 | description: Basic button component 4 | img: '/images/button.svg' 5 | --- 6 | 7 | ## Installing 8 | 9 | Install the component 10 | 11 | ```cli 12 | npm install @supabase/ui 13 | ``` 14 | 15 | ## Getting started 16 | 17 | Import the component 18 | 19 | ```js 20 | import { Badge } from '@supabase/ui' 21 | ``` 22 | 23 | ## Basic 24 | 25 | 26 | 27 | ## Dot 28 | 29 | 30 | 31 | ## API reference 32 | 33 | 34 | -------------------------------------------------------------------------------- /_components/button/ButtonBasic.js: -------------------------------------------------------------------------------- 1 | import { Button } from "@supabase/ui"; 2 | 3 | export default function BasicButton() { 4 | return ; 5 | } 6 | -------------------------------------------------------------------------------- /_components/button/ButtonBlock.js: -------------------------------------------------------------------------------- 1 | import { Button } from "@supabase/ui"; 2 | 3 | export default function ButtonBlock() { 4 | return ; 5 | } 6 | -------------------------------------------------------------------------------- /_components/button/ButtonIcons.js: -------------------------------------------------------------------------------- 1 | import { Button, IconMail } from "@supabase/ui"; 2 | 3 | export default function ButtonIcons() { 4 | return ( 5 | <> 6 | 7 | 8 | 9 | ); 10 | } 11 | -------------------------------------------------------------------------------- /_components/button/ButtonSizes.js: -------------------------------------------------------------------------------- 1 | import { Button } from "@supabase/ui"; 2 | 3 | export default function ButtonSizes() { 4 | return ( 5 | <> 6 | 7 | 8 | 9 | 10 | 11 | 12 | ); 13 | } 14 | -------------------------------------------------------------------------------- /_components/button/ButtonTypes.js: -------------------------------------------------------------------------------- 1 | import { Button } from "@supabase/ui"; 2 | 3 | export default function ButtonTypes() { 4 | return ( 5 | <> 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | ); 14 | } 15 | -------------------------------------------------------------------------------- /_components/button/index.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: Button 3 | description: Basic button component 4 | img: "/images/button.svg" 5 | --- 6 | 7 | ## Installing 8 | 9 | Install the component 10 | 11 | ```cli 12 | npm install @supabase/ui 13 | ``` 14 | 15 | ## Getting started 16 | 17 | Import the component 18 | 19 | ```js 20 | import { Button } from '@supabase/ui' 21 | ``` 22 | 23 | ## Basic 24 | 25 | You can define the type of a button using the `type` prop. There are `primary`, `default`, `secondary`, `outline`, `dashed`, and `text`, 26 | 27 | 28 | 29 | ## Button types 30 | 31 | You can define the type of a button using the `type` prop. 32 | 33 | There are `primary`, `default`, `secondary`, `outline`, `dashed`, and `text`. 34 | 35 | 36 | 37 | ## Size 38 | 39 | You can define the size of a button using the `size` prop. 40 | 41 | There are `tiny`, `small`, `medium`, `large` and `xlarge`. The default size is `tiny` 42 | 43 | 44 | 45 | ## Using icons 46 | 47 | Icons can be used with a Button using the `icon` prop. You can import any [Icon]("https://github.com/supabase/ui#using-icons") component from Supabase UI. 48 | 49 | If you use Icons from the Supabase UI library, the Icon will respect the size of the Button. For example: if the Button is shown in Xlarge, then the Icon will be shown in XLarge. 50 | 51 | There is also support for icons on the right side of the button using `buttonRight`. 52 | 53 | 54 | 55 | ## With block 56 | 57 | Buttons can be expanded to take the entire width of the space using the prop `block`. 58 | 59 | 60 | 61 | ## API Reference 62 | 63 | 64 | -------------------------------------------------------------------------------- /_components/card/CardBasic.js: -------------------------------------------------------------------------------- 1 | import { Card } from "@supabase/ui"; 2 | 3 | export default function CardBasic() { 4 | return This is the content; 5 | } 6 | -------------------------------------------------------------------------------- /_components/card/CardCover.js: -------------------------------------------------------------------------------- 1 | import { Card } from "@supabase/ui"; 2 | 3 | export default function CardCover() { 4 | return ( 5 | , 12 | ]} 13 | > 14 | This is the content 15 | 16 | ); 17 | } 18 | -------------------------------------------------------------------------------- /_components/card/CardHoverable.js: -------------------------------------------------------------------------------- 1 | import { Card } from "@supabase/ui"; 2 | 3 | export default function CardHoverable() { 4 | return ( 5 | , 13 | ]} 14 | > 15 | 16 | 17 | ); 18 | } 19 | -------------------------------------------------------------------------------- /_components/card/CardMeta.js: -------------------------------------------------------------------------------- 1 | import { Card } from "@supabase/ui"; 2 | 3 | export default function CardMeta() { 4 | return ( 5 | , 12 | ]} 13 | > 14 | 15 | 16 | ); 17 | } 18 | -------------------------------------------------------------------------------- /_components/card/index.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: Card 3 | description: Basic button component 4 | img: '/images/button.svg' 5 | --- 6 | 7 | ## Installing 8 | 9 | Install the component 10 | 11 | ```cli 12 | npm install @supabase/ui 13 | ``` 14 | 15 | ## Getting started 16 | 17 | Import the component 18 | 19 | ```js 20 | import { Card } from '@supabase/ui' 21 | ``` 22 | 23 | ## Basic 24 | 25 | 26 | 27 | ## Cover 28 | 29 | 30 | 31 | ## Meta 32 | 33 | 34 | 35 | ## Hoverable 36 | 37 | 38 | 39 | ## API reference 40 | 41 | ##### Card 42 | 43 | Coming soon 44 | -------------------------------------------------------------------------------- /_components/checkbox/CheckboxBasic.js: -------------------------------------------------------------------------------- 1 | import { Checkbox } from "@supabase/ui"; 2 | 3 | function handleOnChange(e) { 4 | // use e.target.checked 5 | } 6 | 7 | export default function CheckboxBasic() { 8 | return ; 9 | } 10 | -------------------------------------------------------------------------------- /_components/checkbox/CheckboxControlled.js: -------------------------------------------------------------------------------- 1 | import { Checkbox } from "@supabase/ui"; 2 | import { useState } from "react"; 3 | 4 | export default function CheckboxControlled() { 5 | const [checked, setChecked] = useState(true); 6 | 7 | function handleOnChange() { 8 | setChecked(!checked); 9 | console.log("checking"); 10 | } 11 | 12 | return ( 13 | 19 | ); 20 | } 21 | -------------------------------------------------------------------------------- /_components/checkbox/CheckboxGrouped.js: -------------------------------------------------------------------------------- 1 | import { Checkbox } from "@supabase/ui"; 2 | 3 | export default function CheckboxGrouped() { 4 | return ( 5 |
6 | 12 | 16 | 20 | 21 |
22 | ); 23 | } 24 | -------------------------------------------------------------------------------- /_components/checkbox/index.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: Checkbox 3 | description: Data input that can be used in a group or individually 4 | img: "/images/button.svg" 5 | --- 6 | 7 | ## When to use 8 | 9 | - Used for selecting a selection from an array of options 10 | - Using just one checkbox is similar to using the Toggle component although the checkbox uses an Input tag that needs to be submitted 11 | 12 | ## Installing 13 | 14 | Import the component 15 | 16 | ```js 17 | import { Checkbox } from '@supabase/ui' 18 | ``` 19 | 20 | ## Basic 21 | 22 | You can use a single checkbox alone, with just a `label`. You can then use the prop `onChange` for change events. 23 | 24 | 25 | 26 | ## Controlled checkbox 27 | 28 | ### ⚠️ This doesn't work at the moment 29 | 30 | Requires value to be used in Checkbox.Group so that component can be controlled by React state. 31 | 32 | ! Also there is no DefaultValue 33 | 34 | 35 | 36 | ## Grouped checkboxes 37 | 38 | Checkboxes allow for multiple selections so they are sometimes used in part of a group. You can wrap Checkboxes in a subcomponent called ``. 39 | 40 | You can use the `onChange` prop on either the group subcomponent or the `Checkbox` components individually. 41 | 42 | 43 | 44 | ## API reference 45 | 46 | #### Checkbox 47 | 48 | coming soon 49 | 50 | #### Checkbox.Group 51 | 52 | coming soon 53 | -------------------------------------------------------------------------------- /_components/dropdown/DropdownBasic.js: -------------------------------------------------------------------------------- 1 | import { 2 | Button, 3 | Divider, 4 | Dropdown, 5 | IconClipboard, 6 | IconCopy, 7 | IconTrash, 8 | Typography, 9 | } from '@supabase/ui' 10 | 11 | export default function DropdownBasic() { 12 | return ( 13 | }> 16 | Copy 17 | , 18 | }> 19 | Duplicate 20 | , 21 | , 22 | }> 23 | Delete 24 | , 25 | ]} 26 | > 27 | 28 | 29 | ) 30 | } 31 | -------------------------------------------------------------------------------- /_components/dropdown/DropdownCheckbox.js: -------------------------------------------------------------------------------- 1 | import { useState } from 'react' 2 | import { Button, Divider, Dropdown, Typography } from '@supabase/ui' 3 | 4 | export default function DropdownCheckbox() { 5 | const [checked, setChecked] = useState(false) 6 | 7 | return ( 8 | 11 | Option one 12 | , 13 | 14 | Option two 15 | , 16 | , 17 | 18 | One 19 | , 20 | ]} 21 | > 22 | 23 | 24 | ) 25 | } 26 | -------------------------------------------------------------------------------- /_components/dropdown/DropdownDoNotClose.js: -------------------------------------------------------------------------------- 1 | import { 2 | Dropdown, 3 | Button, 4 | Divider, 5 | Typography, 6 | IconLogOut, 7 | IconSettings, 8 | IconChevronDown, 9 | } from '@supabase/ui' 10 | 11 | export default function DropdownBasic() { 12 | return ( 13 | }> 16 | This will not close dropdown 17 | , 18 | , 19 | 20 | Option one 21 | , 22 | 23 | Option two 24 | , 25 | 26 | , 27 | }> 28 | Log out 29 | , 30 | ]} 31 | > 32 | 35 | 36 | ) 37 | } 38 | -------------------------------------------------------------------------------- /_components/dropdown/DropdownPlacement.js: -------------------------------------------------------------------------------- 1 | import { 2 | Button, 3 | Divider, 4 | Dropdown, 5 | IconClipboard, 6 | IconCopy, 7 | IconTrash, 8 | Typography, 9 | } from '@supabase/ui' 10 | 11 | export default function DropdownBasic() { 12 | const Overlay = () => ( 13 | <> 14 | }> 15 | Copy 16 | 17 | }> 18 | Duplicate 19 | 20 | 21 | }> 22 | Delete 23 | 24 | 25 | ) 26 | 27 | return ( 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 | -------------------------------------------------------------------------------- /_components/dropdown/DropdownRadio.js: -------------------------------------------------------------------------------- 1 | import { useState } from 'react' 2 | import { Button, Dropdown, Typography } from '@supabase/ui' 3 | 4 | export default function DropdownRadio() { 5 | const [value, setValue] = useState('one') 6 | 7 | return ( 8 | 11 | 12 | One 13 | 14 | 15 | Two 16 | 17 | 18 | Three 19 | 20 | , 21 | ]} 22 | > 23 | 24 | 25 | ) 26 | } 27 | -------------------------------------------------------------------------------- /_components/dropdown/index.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: Dropdown 3 | description: Basic button component 4 | img: '/images/button.svg' 5 | --- 6 | 7 | ## Installing 8 | 9 | Install the component 10 | 11 | ```cli 12 | npm install @supabase/ui 13 | ``` 14 | 15 | ## Getting started 16 | 17 | Import the component 18 | 19 | ```js 20 | import { Dropdown } from '@supabase/ui' 21 | ``` 22 | 23 | ## Basic 24 | 25 | Use the children of Dropdown for the trigger element that will open the dropdown. Use `overlay` to insert any react node to show in the dropdown. 26 | 27 | `Dropdown.Item` is used inside the `overlay` to define clickable options. By clicking on them, they automatically close the Dropdown. 28 | 29 | You may also want to use the `Typography` component in `Dropdown.Item` to keep text consistent, and add support for dark/light mode variations. 30 | 31 | `Dropdown.Item` also has an `icon` prop in which you can pass any Icon (Docs coming soon). 32 | 33 | 34 | 35 | ## Placement 36 | 37 | Choose where the dropdown appears with `side` and `align`. 38 | The dropdown will automatically reposition its self if it collides with the edge of the viewable area. 39 | 40 | 41 | 42 | ## Do not close 43 | 44 | You can use `Dropdown.Misc` to add an item that isn't part of a menu. 45 | 46 | 47 | 48 | ## Radio 49 | 50 | Using a Radio selection of options 51 | 52 | 53 | 54 | ## Checkbox 55 | 56 | Using a Checkbox option 57 | 58 | 59 | 60 | ## API Reference 61 | 62 | #### Dropdown 63 | 64 | 65 | 66 | #### Dropdown.Item 67 | 68 | Coming soon 69 | -------------------------------------------------------------------------------- /_components/icon/IconBasic.js: -------------------------------------------------------------------------------- 1 | import { IconMail } from '@supabase/ui' 2 | 3 | export default function BasicIcon() { 4 | return 5 | } 6 | -------------------------------------------------------------------------------- /_components/icon/IconSize.js: -------------------------------------------------------------------------------- 1 | import { IconMail } from '@supabase/ui' 2 | 3 | export default function IconSizes() { 4 | return ( 5 | <> 6 | 7 | 8 | 9 | 10 | 11 | 12 | ) 13 | } 14 | -------------------------------------------------------------------------------- /_components/icon/IconStroke.js: -------------------------------------------------------------------------------- 1 | import { IconMail } from '@supabase/ui' 2 | 3 | export default function IconSizes() { 4 | return ( 5 | <> 6 | 7 | 8 | 9 | 10 | ) 11 | } 12 | -------------------------------------------------------------------------------- /_components/icon/index.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: Icon 3 | description: Icon component 4 | img: "/images/icon.svg" 5 | --- 6 | 7 | ## Installing 8 | 9 | Install the component 10 | 11 | ```cli 12 | npm install @supabase/ui 13 | ``` 14 | 15 | ## Getting started 16 | 17 | Import the component 18 | 19 | ```js 20 | import { IconMail } from '@supabase/ui' 21 | ``` 22 | 23 | ## Basic 24 | 25 | We use Feather icon library in Supabase UI 26 | 27 | You can use any Icon from the library as a component by prepending Icon to any Icon name, like, 28 | 29 | 30 | 31 | ## Icon Size 32 | 33 | You can define the size of an icon using the `size` prop. 34 | The `size` prop is a `font-size` points (pt) integer 35 | 36 | 37 | 38 | ## Icon Stroke Width 39 | 40 | You can define the stroke width (line thickness) using the `strokeWidth` prop 41 | 42 | 43 | 44 | ## API Reference 45 | 46 | -------------------------------------------------------------------------------- /_components/input/InputBasic.js: -------------------------------------------------------------------------------- 1 | import { Input } from "@supabase/ui"; 2 | 3 | export default function InputBasic() { 4 | return ; 5 | } 6 | -------------------------------------------------------------------------------- /_components/input/InputControls.js: -------------------------------------------------------------------------------- 1 | import { Button, IconActivity, Input } from "@supabase/ui"; 2 | 3 | export default function InputBasic() { 4 | return ( 5 | }> 9 | Check status 10 | , 11 | , 12 | ]} 13 | /> 14 | ); 15 | } 16 | -------------------------------------------------------------------------------- /_components/input/InputCopy.js: -------------------------------------------------------------------------------- 1 | import { Input } from "@supabase/ui"; 2 | 3 | export default function InputBasic() { 4 | return ; 5 | } 6 | -------------------------------------------------------------------------------- /_components/input/InputError.js: -------------------------------------------------------------------------------- 1 | import { Input } from "@supabase/ui"; 2 | 3 | export default function InputError() { 4 | return ; 5 | } 6 | -------------------------------------------------------------------------------- /_components/input/InputIcon.js: -------------------------------------------------------------------------------- 1 | import { IconMail, Input } from "@supabase/ui"; 2 | 3 | export default function InputBasic() { 4 | return ( 5 | } 9 | type="email" 10 | /> 11 | ); 12 | } 13 | -------------------------------------------------------------------------------- /_components/input/InputLabels.js: -------------------------------------------------------------------------------- 1 | import { Input } from "@supabase/ui"; 2 | 3 | export default function InputBasic() { 4 | return ( 5 | 10 | ); 11 | } 12 | -------------------------------------------------------------------------------- /_components/input/InputReveal.js: -------------------------------------------------------------------------------- 1 | import { Input } from "@supabase/ui"; 2 | 3 | export default function InputBasic() { 4 | return ; 5 | } 6 | -------------------------------------------------------------------------------- /_components/input/InputTextArea.js: -------------------------------------------------------------------------------- 1 | import { Input } from "@supabase/ui"; 2 | 3 | export default function InputBasic() { 4 | return ; 5 | } 6 | -------------------------------------------------------------------------------- /_components/input/InputTextAreaWithLimit.js: -------------------------------------------------------------------------------- 1 | import { Input } from "@supabase/ui"; 2 | 3 | export default function InputTextAreaWithLimit() { 4 | return ( 5 | 12 | ); 13 | } 14 | -------------------------------------------------------------------------------- /_components/input/index.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: Input 3 | description: Basic button component 4 | img: "/images/button.svg" 5 | --- 6 | 7 | ## Installing 8 | 9 | Install the component 10 | 11 | ```cli 12 | npm install @supabase/ui 13 | ``` 14 | 15 | ## Getting started 16 | 17 | Import the component 18 | 19 | ```js 20 | import { Input } from '@supabase/ui' 21 | ``` 22 | 23 | ## Basic 24 | 25 | An Input component will default to using `type="text"`. You can define a `label`. 26 | 27 | `type` can be used to show what kind of input you need. It supports all Input types, except for the following: 28 | 29 | - Number, use [InputNumber](/components/inputnumber) 30 | - Radio, use [Radio](/components/radio) 31 | - Checkbox, use [Checkbox](/components/checkbox) 32 | 33 | 34 | 35 | ## Input labels 36 | 37 | You can use `label`, `descriptionText` and `labelOptional` to illustrate what your Input is for and demonstrate to the user what they need to input. 38 | 39 | 40 | 41 | ## Icon 42 | 43 | use `Icon` to inject any Icon component you like. 44 | 45 | 46 | 47 | ## Copy value 48 | 49 | Use `copy` to add a copy button. It will copy the value of `value` 50 | 51 | 52 | 53 | ## Reveal and copy 54 | 55 | Use `copy` to add a copy button. It will copy the value of `value` 56 | 57 | 58 | 59 | ## Actions 60 | 61 | Use `actions` to inject any React.ReactNode jsx 62 | 63 | 64 | 65 | ## Error 66 | 67 | Use `error` with a string to show an error message 68 | 69 | 70 | 71 | ## Text Area 72 | 73 | Use `` to use a text area input 74 | 75 | 76 | 77 | ## Text Area with limit 78 | 79 | Use `` to use a text area input 80 | 81 | 82 | 83 | ## API Reference 84 | 85 | #### Input 86 | 87 | 88 | 89 | #### Input.TextArea 90 | 91 | Coming soon 92 | -------------------------------------------------------------------------------- /_components/inputnumber/InputNumberBasic.js: -------------------------------------------------------------------------------- 1 | import { InputNumber } from "@supabase/ui"; 2 | 3 | export default function InputNumberBasic() { 4 | return ; 5 | } 6 | -------------------------------------------------------------------------------- /_components/inputnumber/InputNumberMinMax.js: -------------------------------------------------------------------------------- 1 | import { InputNumber } from "@supabase/ui"; 2 | 3 | export default function InputNumberBasic() { 4 | return ; 5 | } 6 | -------------------------------------------------------------------------------- /_components/inputnumber/index.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: InputNumber 3 | description: Basic button component 4 | img: "/images/button.svg" 5 | --- 6 | 7 | ## Installing 8 | 9 | Install the component 10 | 11 | ```cli 12 | npm install @supabase/ui 13 | ``` 14 | 15 | ## Getting started 16 | 17 | Import the component 18 | 19 | ```js 20 | import { InputNumber } from '@supabase/ui' 21 | ``` 22 | 23 | ## Basic 24 | 25 | 26 | 27 | ## Min and Max 28 | 29 | You can define the `min` and `max` that the InputNumber allows, which will disallow a form from submitting. 30 | 31 | 32 | 33 | ## API reference 34 | 35 | 36 | -------------------------------------------------------------------------------- /_components/menu/MenuActiveState.js: -------------------------------------------------------------------------------- 1 | import { IconClipboard, IconCopy, IconTrash, Menu } from "@supabase/ui"; 2 | 3 | export default function MenuActiveState() { 4 | return ( 5 | 6 | 7 | }> 8 | Copy 9 | 10 | }>Duplicate 11 | }>Delete 12 | 13 | }>Copy 14 | }> 15 | Duplicate 16 | 17 | }>Delete 18 | 19 | ); 20 | } 21 | -------------------------------------------------------------------------------- /_components/menu/MenuBasic.js: -------------------------------------------------------------------------------- 1 | import { 2 | Divider, 3 | IconClipboard, 4 | IconCopy, 5 | IconTrash, 6 | Menu, 7 | } from "@supabase/ui"; 8 | 9 | export default function MenuBasic() { 10 | return ( 11 | 12 | }>Copy 13 | }>Duplicate 14 | 15 | }>Delete 16 | 17 | ); 18 | } 19 | -------------------------------------------------------------------------------- /_components/menu/MenuWithGroups.js: -------------------------------------------------------------------------------- 1 | import { IconClipboard, IconCopy, IconTrash, Menu } from "@supabase/ui"; 2 | 3 | export default function MenuBasic() { 4 | return ( 5 | 6 | 7 | }>Copy 8 | }>Duplicate 9 | }>Delete 10 | 11 | }>Copy 12 | }>Duplicate 13 | }>Delete 14 | 15 | ); 16 | } 17 | -------------------------------------------------------------------------------- /_components/menu/index.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: Menu 3 | description: Basic button component 4 | img: "/images/button.svg" 5 | --- 6 | 7 | ## Installing 8 | 9 | Install the component 10 | 11 | ```cli 12 | npm install @supabase/ui 13 | ``` 14 | 15 | ## Getting started 16 | 17 | Import the component 18 | 19 | ```js 20 | import { Menu } from '@supabase/ui' 21 | ``` 22 | 23 | ## Basic 24 | 25 | The Menu component is made up of a parent component and then subcomponents that dictate menu items and group labels. 26 | Dividers can be used to split up items. 27 | 28 | 29 | 30 | ## Groups 31 | 32 | Use Group subcomponent to split up the menu with group labels 33 | 34 | 35 | 36 | ## Active state 37 | 38 | An active state can be shown with `active` and, additionally a border can be shown with `showActiveBar`. 39 | 40 | 41 | 42 | ## API reference 43 | 44 | #### Menu 45 | 46 | Coming soon 47 | 48 | #### Menu.Item 49 | 50 | coming soon 51 | 52 | #### Menu.Group 53 | 54 | coming soon 55 | 56 | #### Menu.Misc 57 | 58 | coming soon 59 | -------------------------------------------------------------------------------- /_components/modal/ModalBasic.js: -------------------------------------------------------------------------------- 1 | import { Button, IconInfo, Modal, Typography } from "@supabase/ui"; 2 | import { useState } from "react"; 3 | 4 | export default function ModalBasic() { 5 | const [visible, setVisible] = useState(false); 6 | 7 | function toggle() { 8 | setVisible(!visible); 9 | } 10 | 11 | return ( 12 | <> 13 | 16 | 23 | This is the content of the Modal 24 | 25 | 26 | ); 27 | } 28 | -------------------------------------------------------------------------------- /_components/modal/ModalCloseButton.js: -------------------------------------------------------------------------------- 1 | import { Button, Modal, Typography } from "@supabase/ui"; 2 | import { useState } from "react"; 3 | 4 | export default function ModalCloseButton() { 5 | const [visible, setVisible] = useState(false); 6 | 7 | function toggle() { 8 | setVisible(!visible); 9 | } 10 | 11 | return ( 12 | <> 13 | 16 | 24 | This is the content of the Modal 25 | 26 | 27 | ); 28 | } 29 | -------------------------------------------------------------------------------- /_components/modal/ModalFooterBackground.js: -------------------------------------------------------------------------------- 1 | import { Button, Modal, Typography } from "@supabase/ui"; 2 | import { useState } from "react"; 3 | 4 | export default function ModalFooterBackground() { 5 | const [visible, setVisible] = useState(false); 6 | 7 | function toggle() { 8 | setVisible(!visible); 9 | } 10 | 11 | return ( 12 | <> 13 | 16 | 24 | This is the content of the Modal 25 | 26 | 27 | ); 28 | } 29 | -------------------------------------------------------------------------------- /_components/modal/ModalFooterCustom.js: -------------------------------------------------------------------------------- 1 | import { 2 | Modal, 3 | Badge, 4 | Button, 5 | IconTrash, 6 | Space, 7 | Typography, 8 | } from "@supabase/ui"; 9 | import { useState } from "react"; 10 | 11 | export default function SidePanelFooterCustom() { 12 | const [visible, setVisible] = useState(false); 13 | 14 | function toggle() { 15 | setVisible(!visible); 16 | } 17 | return ( 18 | <> 19 | 22 | 28 | 29 | 32 | Exercise caution 33 | , 34 | ]} 35 | > 36 | This is the content of the sidepanel 37 | 38 | 39 | ); 40 | } 41 | -------------------------------------------------------------------------------- /_components/modal/ModalFooterCustomVertical.js: -------------------------------------------------------------------------------- 1 | import { 2 | Badge, 3 | Button, 4 | IconTrash, 5 | Modal, 6 | Space, 7 | Typography, 8 | } from "@supabase/ui"; 9 | import { useState } from "react"; 10 | 11 | export default function ModalFooterCustomVertical() { 12 | const [visible, setVisible] = useState(false); 13 | 14 | function toggle() { 15 | setVisible(!visible); 16 | } 17 | 18 | return ( 19 | <> 20 | 23 | 33 | 36 | 39 | , 40 | ]} 41 | > 42 | 43 | Modal content is inserted here, if you need to insert anything into 44 | the Modal you can do so via 45 | 46 | 47 | 48 | ); 49 | } 50 | -------------------------------------------------------------------------------- /_components/modal/ModalFooterCustomVerticalOneButton.js: -------------------------------------------------------------------------------- 1 | import { 2 | Badge, 3 | Button, 4 | IconCheck, 5 | IconTrash, 6 | Modal, 7 | Space, 8 | Typography, 9 | } from "@supabase/ui"; 10 | import { useState } from "react"; 11 | 12 | export default function ModalFooterCustomVerticalOneButton() { 13 | const [visible, setVisible] = useState(false); 14 | 15 | function toggle() { 16 | setVisible(!visible); 17 | } 18 | 19 | return ( 20 | <> 21 | 24 | } 29 | visible={visible} 30 | onCancel={toggle} 31 | onConfirm={toggle} 32 | layout="vertical" 33 | customFooter={[ 34 | 35 | 38 | , 39 | ]} 40 | /> 41 | 42 | ); 43 | } 44 | -------------------------------------------------------------------------------- /_components/modal/ModalFooterHide.js: -------------------------------------------------------------------------------- 1 | import { Button, Modal, Typography } from "@supabase/ui"; 2 | import { useState } from "react"; 3 | 4 | export default function ModalFooterHide() { 5 | const [visible, setVisible] = useState(false); 6 | 7 | function toggle() { 8 | setVisible(!visible); 9 | } 10 | 11 | return ( 12 | <> 13 | 16 | 24 | This is the content of the Modal 25 | 26 | 27 | ); 28 | } 29 | -------------------------------------------------------------------------------- /_components/modal/ModalFooterRightAligned.js: -------------------------------------------------------------------------------- 1 | import { Button, Modal, Typography } from "@supabase/ui"; 2 | import { useState } from "react"; 3 | 4 | export default function ModalFooterRightAligned() { 5 | const [visible, setVisible] = useState(false); 6 | 7 | function toggle() { 8 | setVisible(!visible); 9 | } 10 | 11 | return ( 12 | <> 13 | 16 | 24 | This is the content of the Modal 25 | 26 | 27 | ); 28 | } 29 | -------------------------------------------------------------------------------- /_components/modal/ModalIcon.js: -------------------------------------------------------------------------------- 1 | import { Button, IconAlertCircle, Modal, Typography } from "@supabase/ui"; 2 | import { useState } from "react"; 3 | 4 | export default function ModalBasic() { 5 | const [visible, setVisible] = useState(false); 6 | 7 | function toggle() { 8 | setVisible(!visible); 9 | } 10 | 11 | return ( 12 | <> 13 | 16 | } 23 | > 24 | This is the content of the Modal 25 | 26 | 27 | ); 28 | } 29 | -------------------------------------------------------------------------------- /_components/modal/ModalVertical.js: -------------------------------------------------------------------------------- 1 | import { Button, IconAlertCircle, Modal } from "@supabase/ui"; 2 | import { useState } from "react"; 3 | 4 | export default function ModalBasic() { 5 | const [visible, setVisible] = useState(false); 6 | 7 | function toggle() { 8 | setVisible(!visible); 9 | } 10 | 11 | return ( 12 | <> 13 | 16 | } 25 | /> 26 | 27 | ); 28 | } 29 | -------------------------------------------------------------------------------- /_components/modal/index.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: Modal 3 | description: Overlay component 4 | img: '/images/button.svg' 5 | --- 6 | 7 | ## Installing 8 | 9 | Install the component 10 | 11 | ```cli 12 | npm install @supabase/ui 13 | ``` 14 | 15 | ## Getting started 16 | 17 | Import the component 18 | 19 | ```js 20 | import { Modal } from '@supabase/ui' 21 | ``` 22 | 23 | ## Basic 24 | 25 | 26 | 27 | ## Icon 28 | 29 | 30 | 31 | ## Vertical 32 | 33 | 34 | 35 | ## Close button 36 | 37 | 38 | 39 | ## Footer background 40 | 41 | 42 | 43 | ## Footer right aligned 44 | 45 | 46 | 47 | ## Footer hide 48 | 49 | 50 | 51 | ## Footer custom 52 | 53 | 54 | 55 | ## Footer custom vertical 56 | 57 | 58 | 59 | ## Footer custom vertical one action 60 | 61 | 62 | 63 | ## API reference 64 | 65 | 66 | -------------------------------------------------------------------------------- /_components/radio/RadioBasic.js: -------------------------------------------------------------------------------- 1 | import { Radio } from "@supabase/ui"; 2 | 3 | const myComponentType = ().type; 4 | 5 | export default function RadioBasic() { 6 | console.log(myComponentType); 7 | 8 | function handleOnChange(e) { 9 | // console.log(e.target.value) 10 | } 11 | 12 | return ( 13 | <> 14 | 20 | 26 | 27 | ); 28 | } 29 | -------------------------------------------------------------------------------- /_components/radio/RadioControlled.js: -------------------------------------------------------------------------------- 1 | import { Radio } from "@supabase/ui"; 2 | import { useState } from "react"; 3 | 4 | export default function RadioControlled() { 5 | const [value, setValue] = useState("Novice"); 6 | 7 | function handleOnChange(e) { 8 | setValue(e.target.value); 9 | } 10 | 11 | return ( 12 | 13 | 14 | 15 | 16 | ); 17 | } 18 | -------------------------------------------------------------------------------- /_components/radio/RadioGrouped.js: -------------------------------------------------------------------------------- 1 | import { Radio } from "@supabase/ui"; 2 | 3 | export default function RadioGrouped() { 4 | function handleOnChange(e) { 5 | console.log(e.target.value); 6 | } 7 | 8 | return ( 9 | 14 | 18 | 22 | 23 | ); 24 | } 25 | -------------------------------------------------------------------------------- /_components/radio/RadioGroupedCards.js: -------------------------------------------------------------------------------- 1 | import { Radio } from "@supabase/ui"; 2 | 3 | export default function RadioGrouped() { 4 | return ( 5 | 11 | 15 | 19 | 20 | ); 21 | } 22 | -------------------------------------------------------------------------------- /_components/radio/index.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: Radio 3 | description: Data input that can be used in a group or individually 4 | img: "/images/button.svg" 5 | --- 6 | 7 | ## When to use 8 | 9 | - Used for selecting multiple selections from an array of options 10 | - If using many options, it would make more sense to use a Select, or a Dropdown to facilitate the many options. 11 | 12 | ## Installing 13 | 14 | Import the component 15 | 16 | ```js 17 | import { Radio } from '@supabase/ui' 18 | ``` 19 | 20 | ## Basic 21 | 22 | Radios can be used alone. Pass the same `name` to them. 23 | 24 | 25 | 26 | ## Grouped checkboxes 27 | 28 | Wrap the radio options in a Group, and use the Group to control and receive onChange. 29 | 30 | Use the `` sub component to wrap `` components together. 31 | 32 | You can then set the `name` and use `onChange` for all the radios via the `` component. 33 | 34 | 35 | 36 | ## Controlled checkbox 37 | 38 | ### ⚠️ This doesn't work at the moment 39 | 40 | Requires value to be used in Radio.Group so that component can be controlled by React state. 41 | 42 | ! Also there is no DefaultValue 43 | 44 | 45 | 46 | ## Grouped radio with card styling 47 | 48 | Using the prop `type` you can change the card styling to use `cards`. 49 | 50 | 51 | 52 | ## API reference 53 | 54 | #### Radio 55 | 56 | coming soon 57 | 58 | #### Radio.Group 59 | 60 | coming soon 61 | -------------------------------------------------------------------------------- /_components/select/SelectBasic.js: -------------------------------------------------------------------------------- 1 | import { Select } from "@supabase/ui"; 2 | 3 | export default function SelectBasic() { 4 | function handleChange(e) { 5 | // console.log(e.target.value) 6 | } 7 | return ( 8 | 13 | ); 14 | } 15 | -------------------------------------------------------------------------------- /_components/select/SelectControlled.js: -------------------------------------------------------------------------------- 1 | import { Select } from "@supabase/ui"; 2 | import { useState } from "react"; 3 | 4 | export default function SelectControlled() { 5 | const [value, setValue] = useState("two"); 6 | function handleChange(e) { 7 | // console.log(e.target.value) 8 | setValue(e.target.value); 9 | } 10 | 11 | return ( 12 | 17 | ); 18 | } 19 | -------------------------------------------------------------------------------- /_components/select/SelectError.js: -------------------------------------------------------------------------------- 1 | import { Select } from "@supabase/ui"; 2 | import { useState } from "react"; 3 | 4 | export default function SelectControlled() { 5 | const [value, setValue] = useState("two"); 6 | function handleChange(e) { 7 | // console.log(e.target.value) 8 | setValue(e.target.value); 9 | } 10 | 11 | return ( 12 | 21 | ); 22 | } 23 | -------------------------------------------------------------------------------- /_components/select/SelectIcon.js: -------------------------------------------------------------------------------- 1 | import { IconActivity, Select } from "@supabase/ui"; 2 | import { useState } from "react"; 3 | 4 | export default function SelectControlled() { 5 | const [value, setValue] = useState("two"); 6 | function handleChange(e) { 7 | // console.log(e.target.value) 8 | setValue(e.target.value); 9 | } 10 | 11 | return ( 12 | 21 | ); 22 | } 23 | -------------------------------------------------------------------------------- /_components/select/SelectOptionGroup.js: -------------------------------------------------------------------------------- 1 | import { Select } from "@supabase/ui"; 2 | import { useState } from "react"; 3 | 4 | export default function SelectControlled() { 5 | const [value, setValue] = useState("two"); 6 | function handleChange(e) { 7 | // console.log(e.target.value) 8 | setValue(e.target.value); 9 | } 10 | 11 | return ( 12 | 19 | ); 20 | } 21 | -------------------------------------------------------------------------------- /_components/select/index.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: Select 3 | description: Basic button component 4 | img: "/images/button.svg" 5 | --- 6 | 7 | ## Installing 8 | 9 | Install the component 10 | 11 | ```cli 12 | npm install @supabase/ui 13 | ``` 14 | 15 | ## Getting started 16 | 17 | Import the component 18 | 19 | ```js 20 | import { Select } from '@supabase/ui' 21 | ``` 22 | 23 | ## Basic 24 | 25 | Use the parent component with the subcomponent inside for the options. 26 | Labels and descriptions can be added the the parent Select component. 27 | 28 | 29 | 30 | ## Controlled 31 | 32 | This is a work in progress.. 33 | 34 | 35 | 36 | ## Error 37 | 38 | 39 | 40 | ## Icon 41 | 42 | Insert any Icon from the Supabase UI library. 43 | 44 | 45 | 46 | ## Option group 47 | 48 | OptGroup can be used to split up the Options inside the Select. 49 | 50 | 51 | 52 | ## API reference 53 | 54 | #### Select 55 | 56 | 57 | 58 | #### Select.Option 59 | 60 | coming soon 61 | 62 | #### Select.OptGroup 63 | 64 | coming soon 65 | -------------------------------------------------------------------------------- /_components/sidepanel/SidePanelBasic.js: -------------------------------------------------------------------------------- 1 | import { Button, SidePanel, Typography } from "@supabase/ui"; 2 | import { useState } from "react"; 3 | 4 | export default function SidePanelBasic() { 5 | const [visible, setVisible] = useState(false); 6 | 7 | function toggle() { 8 | setVisible(!visible); 9 | } 10 | return ( 11 | <> 12 | 15 | 20 | This is the content of the sidepanel 21 | 22 | 23 | ); 24 | } 25 | -------------------------------------------------------------------------------- /_components/sidepanel/SidePanelFooterCustom.js: -------------------------------------------------------------------------------- 1 | import { 2 | Badge, 3 | Button, 4 | IconTrash, 5 | SidePanel, 6 | Space, 7 | Typography, 8 | } from "@supabase/ui"; 9 | import { useState } from "react"; 10 | 11 | export default function SidePanelFooterCustom() { 12 | const [visible, setVisible] = useState(false); 13 | 14 | function toggle() { 15 | setVisible(!visible); 16 | } 17 | return ( 18 | <> 19 | 22 | 28 | 29 | 30 | , 31 | ]} 32 | > 33 | 34 | SidePanel content is inserted here, if you need to insert anything 35 | into the SidePanel you can do so via{" "} 36 | {"{children}"} 37 | 38 | 39 | 40 | ); 41 | } 42 | -------------------------------------------------------------------------------- /_components/sidepanel/SidePanelFooterHide.js: -------------------------------------------------------------------------------- 1 | import { Button, SidePanel, Typography } from "@supabase/ui"; 2 | import { useState } from "react"; 3 | 4 | export default function SidePanelFooterHide() { 5 | const [visible, setVisible] = useState(false); 6 | 7 | function toggle() { 8 | setVisible(!visible); 9 | } 10 | return ( 11 | <> 12 | 15 | 21 | This is the content of the sidepanel 22 | 23 | 24 | ); 25 | } 26 | -------------------------------------------------------------------------------- /_components/sidepanel/SidePanelFooterLeftAligned.js: -------------------------------------------------------------------------------- 1 | import { Button, SidePanel, Typography } from "@supabase/ui"; 2 | import { useState } from "react"; 3 | 4 | export default function SidePanelFooterLeftAligned() { 5 | const [visible, setVisible] = useState(false); 6 | 7 | function toggle() { 8 | setVisible(!visible); 9 | } 10 | return ( 11 | <> 12 | 15 | 20 | This is the content of the sidepanel 21 | 22 | 23 | ); 24 | } 25 | -------------------------------------------------------------------------------- /_components/sidepanel/SidePanelLeftAligned.js: -------------------------------------------------------------------------------- 1 | import { Button, SidePanel, Typography } from "@supabase/ui"; 2 | import { useState } from "react"; 3 | 4 | export default function SidePanelLeftAligned() { 5 | const [visible, setVisible] = useState(false); 6 | 7 | function toggle() { 8 | setVisible(!visible); 9 | } 10 | return ( 11 | <> 12 | 15 | 21 | This is the content of the sidepanel 22 | 23 | 24 | ); 25 | } 26 | -------------------------------------------------------------------------------- /_components/sidepanel/SidePanelWide.js: -------------------------------------------------------------------------------- 1 | import { Button, SidePanel, Typography } from "@supabase/ui"; 2 | import { useState } from "react"; 3 | 4 | export default function SidePanelWide() { 5 | const [visible, setVisible] = useState(false); 6 | 7 | function toggle() { 8 | setVisible(!visible); 9 | } 10 | return ( 11 | <> 12 | 15 | 21 | This is the content of the sidepanel 22 | 23 | 24 | ); 25 | } 26 | -------------------------------------------------------------------------------- /_components/sidepanel/index.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: Sidepanel 3 | description: Overlay component 4 | img: '/images/button.svg' 5 | --- 6 | 7 | ## Installing 8 | 9 | Install the component 10 | 11 | ```cli 12 | npm install @supabase/ui 13 | ``` 14 | 15 | ## Getting started 16 | 17 | Import the component 18 | 19 | ```js 20 | @import { SidePanel } from '@supabase/ui' 21 | ``` 22 | 23 | ## Basic 24 | 25 | 26 | 27 | ## Footer custom 28 | 29 | 30 | 31 | ## Footer hide 32 | 33 | 34 | 35 | ## Left aligned 36 | 37 | 38 | 39 | ## Wide 40 | 41 | 42 | 43 | ## API reference 44 | 45 | 46 | -------------------------------------------------------------------------------- /_components/tabs/TabsAddOnBefore.js: -------------------------------------------------------------------------------- 1 | import { Button, Tabs } from "@supabase/ui"; 2 | 3 | export default function TabsSize() { 4 | return ( 5 | Action button]} 10 | > 11 | 12 | Tab one content 13 | 14 | 15 | Tab two content 16 | 17 | 18 | Tab three content 19 | 20 | 21 | ); 22 | } 23 | -------------------------------------------------------------------------------- /_components/tabs/TabsBasic.js: -------------------------------------------------------------------------------- 1 | import { Tabs } from "@supabase/ui"; 2 | 3 | export default function TabsBasic() { 4 | return ( 5 | 6 | 7 | Tab one content 8 | 9 | 10 | Tab two content 11 | 12 | 13 | Tab three content 14 | 15 | 16 | ); 17 | } 18 | -------------------------------------------------------------------------------- /_components/tabs/TabsBlock.js: -------------------------------------------------------------------------------- 1 | import { Tabs } from "@supabase/ui"; 2 | 3 | export default function TabsSize() { 4 | return ( 5 | 6 | 7 | Tab one content 8 | 9 | 10 | Tab two content 11 | 12 | 13 | Tab three content 14 | 15 | 16 | ); 17 | } 18 | -------------------------------------------------------------------------------- /_components/tabs/TabsIcon.js: -------------------------------------------------------------------------------- 1 | import { IconAlertCircle, Tabs } from "@supabase/ui"; 2 | 3 | export default function TabsBasic() { 4 | return ( 5 | 6 | } label="Tab one"> 7 | Tab one content 8 | 9 | } label="Tab two"> 10 | Tab two content 11 | 12 | } label="Tab three"> 13 | Tab three content 14 | 15 | 16 | ); 17 | } 18 | -------------------------------------------------------------------------------- /_components/tabs/TabsScrollable.js: -------------------------------------------------------------------------------- 1 | import { Tabs, Typography } from "@supabase/ui"; 2 | 3 | export default function TabsSize() { 4 | const limit = 30; 5 | let infitniteSroll = []; 6 | 7 | for (var i = 0; i < limit; i++) { 8 | infitniteSroll.push( 9 | 10 | Content for the panel {i} 11 | 12 | ); 13 | } 14 | 15 | return ( 16 | 17 | {infitniteSroll} 18 | 19 | ); 20 | } 21 | -------------------------------------------------------------------------------- /_components/tabs/TabsSize.js: -------------------------------------------------------------------------------- 1 | import { Tabs } from "@supabase/ui"; 2 | 3 | export default function TabsSize() { 4 | return ( 5 | 6 | 7 | Tab one content 8 | 9 | 10 | Tab two content 11 | 12 | 13 | Tab three content 14 | 15 | 16 | ); 17 | } 18 | -------------------------------------------------------------------------------- /_components/tabs/TabsUnderline.js: -------------------------------------------------------------------------------- 1 | import { Tabs } from "@supabase/ui"; 2 | 3 | export default function TabsBasic() { 4 | return ( 5 | 6 | 7 | Tab one content 8 | 9 | 10 | Tab two content 11 | 12 | 13 | Tab three content 14 | 15 | 16 | ); 17 | } 18 | -------------------------------------------------------------------------------- /_components/tabs/index.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: Tabs 3 | description: Basic button component 4 | img: '/images/button.svg' 5 | --- 6 | 7 | ## Installing 8 | 9 | Install the component 10 | 11 | ```cli 12 | npm install @supabase/ui 13 | ``` 14 | 15 | ## Getting started 16 | 17 | Import the component 18 | 19 | ```js 20 | import { Tabs } from '@supabase/ui' 21 | ``` 22 | 23 | ## Basic 24 | 25 | Tabs can show panels which can be toggled between with buttons above. 26 | Add content inside the Panel component, which it's own `id` and `label`. 27 | 28 | 29 | 30 | ## Underline 31 | 32 | 33 | 34 | ## Icon 35 | 36 | Inject any Icon from Supabase UI into any Panel and it will show in the button above. 37 | 38 | 39 | 40 | ## Block 41 | 42 | Stretch the buttons across the full width of the panel. 43 | 44 | 45 | 46 | ## Scrollable 47 | 48 | Allow the buttons to scroll if beyond the width of the panel. 49 | 50 | 51 | 52 | ## Size 53 | 54 | Set the size of the buttons. 55 | 56 | 57 | 58 | ## AddOnBefore 59 | 60 | Insert any react node in `AddOnBefore` or `AddOnAfter` to inject anything before or after the buttons. 61 | 62 | 63 | 64 | ## API reference 65 | 66 | #### Tabs 67 | 68 | Coming soon 69 | 70 | #### Tabs.Panel 71 | 72 | Coming soon 73 | -------------------------------------------------------------------------------- /_components/typography/TypographyText.js: -------------------------------------------------------------------------------- 1 | import { Typography } from "@supabase/ui"; 2 | 3 | export default function TypographyText() { 4 | return ( 5 | <> 6 | Supabase UI (default) 7 |
8 | 9 | Supabase UI (secondary) 10 | 11 |
12 | Supabase UI (success) 13 |
14 | Supabase UI (warning) 15 |
16 | Supabase UI (danger) 17 |
18 | Supabase UI (disabled) 19 |
20 | Supabase UI (mark) 21 |
22 | Supabase UI (code) 23 |
24 | Supabase UI (keyboard) 25 |
26 | Supabase UI (underline) 27 |
28 | 29 | Supabase UI (strikethrough) 30 | 31 |
32 | Supabase UI (strong) 33 |
34 | 35 | Supabase (Link) 36 | 37 | 38 | ); 39 | } 40 | -------------------------------------------------------------------------------- /_components/typography/TypographyTitles.js: -------------------------------------------------------------------------------- 1 | import { Typography } from "@supabase/ui"; 2 | 3 | export default function TypographyText() { 4 | return ( 5 | <> 6 | Hello world 7 | Hello world 8 | Hello world 9 | Hello world 10 | Hello world 11 | 12 | ); 13 | } 14 | -------------------------------------------------------------------------------- /_components/typography/index.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: Typography 3 | description: Basic button component 4 | img: '/images/button.svg' 5 | --- 6 | 7 | ## Installing 8 | 9 | Install the component 10 | 11 | ```cli 12 | npm install @supabase/ui 13 | ``` 14 | 15 | ## Getting started 16 | 17 | Import the component 18 | 19 | ```js 20 | import { Typography } from '@supabase/ui' 21 | ``` 22 | 23 | This component contains sub components which might be easier to use in variables. 24 | Alternative import method can be to do the following. 25 | 26 | ```js 27 | import { Typography } from '@supabase/ui' 28 | 29 | const { Title, Text, Link } = Typography; 30 | 31 | I am some text 32 | I am some text 33 | I am some link 34 | ``` 35 | 36 | ## Titles 37 | 38 | You can define the level of a title by using the `level` prop. The level should be a number between `1` and `5`. 39 | 40 | 41 | 42 | ## Text 43 | 44 | You can use the Text subcomponent for various misc text. You can also use a `

` tag inside them if needed. 45 | 46 | 47 | 48 | ## API Reference 49 | 50 | #### Typography.Title 51 | 52 | 53 | 54 | #### Typography.Text 55 | 56 | 57 | 58 | #### Typography.Link 59 | 60 | 61 | -------------------------------------------------------------------------------- /_posts/Introduction.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: Supabase UI 3 | description: An open-source UI component library inspired by Tailwind and AntDesign. 4 | --- 5 | 6 | Supabase UI is a high-level UI component library with a focus on creating beautiful apps quickly and efficiently. 7 | Supabase UI is designed to be used with Tailwind CSS utility classes. 8 | 9 |

48 | 49 |
50 | ⚠️ This library is still a work in progress and is not production ready 51 |
52 | 53 | ## Vision 54 | 55 | We have compiled repetitive UI patterns into components that we use across the Supabase suite of apps and examples. 56 | This library gives us a consistent brand, and accelerates our development/prototyping. 57 | 58 | We know there is already a large supply of UI libraries available online. This library is primarily to serve Supabase, but we hope that it 59 | can also be beneficial for apps that are built with Supabase. 60 | 61 | For example, we provide full components (like Auth widgets), which you can simply drop into your website. 62 | 63 | Over time, this library will expand to include a broader range of components and customization. By that stage we hope it will be 64 | beneficial even to developers outside of the Supabase ecosystem. 65 | 66 | ## Key Features 67 | 68 | ### Tailwind friendly 69 | 70 | We have compiled a group of aesthetically pleasing components with design inspiration from existing UI libraries and Tailwind UI examples. 71 | 72 | We try to allow Tailwind CSS classes be used for animations and we strongly encourage you to use a Tailwind config with Supabase UI. 73 | 74 | ### Open source 75 | 76 | Supabase UI is open source, and MIT licensed (fully permissive). 77 | 78 | Supabase UI uses libraries which are also permissively licensed, if they are lightweight, modular, and active. This is better for the ecosystem, rather than doing everything ourselves. 79 | These libraries include: 80 | 81 | - [Tailwind CSS](https://tailwindcss.com/) 82 | - [Feather Icons](https://feathericons.com/) 83 | - Libraries which handle design patterns like context menus, toast messages and interactive tables. 84 | 85 | ### Uncontrolled 86 | 87 | All components are designed to be used controlled and uncontrolled. 88 | We go to great lengths to ensure you don't need local states unnecessarily. Instead, we provide callbacks for useful interactions or state changes. 89 | 90 | ### Developer experience 91 | 92 | Supabase UI is fully typed wherever possible (it is an ongoing effort). 93 | 94 | Part of the focus has also been on making sure components can be controlled and uncontrolled. 95 | We are going to some effort in making sure that you don't need to keep local states for unnecessary things but rather provide callbacks for useful interactions or state changes. 96 | This is also an ongoing effort as some components are half implemented or perhaps not tested yet. 97 | 98 | ### WAI ARIA 99 | 100 | We are trying to make our components adhere to the [WAI-ARIA design patterns](https://www.w3.org/TR/wai-aria-practices-1.2). 101 | We would like to see Supabase UI handle aria and role attributes, focus management and also keyboard navigation. 102 | 103 | ### GitHub 104 | 105 | To file issues, request features, and contribute, check out our [GitHub](https://github.com/supabase/ui). 106 | -------------------------------------------------------------------------------- /_posts/License.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: MIT License 3 | --- 4 | 5 | Copyright (c) 2021 Supabase 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. 24 | -------------------------------------------------------------------------------- /components/CodeBlock/CodeBlock.module.css: -------------------------------------------------------------------------------- 1 | .code-block::before { 2 | content: ""; 3 | background: #1e1e1e; 4 | height: 10px; 5 | width: 48px; 6 | display: block; 7 | } 8 | 9 | .code-block::after { 10 | content: ""; 11 | background: #1e1e1e; 12 | height: 12px; 13 | width: 48px; 14 | display: block; 15 | } 16 | 17 | .code-block code .linenumber { 18 | margin-right: 4px; 19 | } 20 | -------------------------------------------------------------------------------- /components/CodeBlock/CodeBlock.tsx: -------------------------------------------------------------------------------- 1 | import { Light as SyntaxHighlighter } from "react-syntax-highlighter"; 2 | import monokaiCustomTheme from "data/CodeEditorTheme"; 3 | import CodeBlockStyles from "./CodeBlock.module.css"; 4 | import { Button, IconCopy } from "@supabase/ui"; 5 | import CopyToClipboard from "react-copy-to-clipboard"; 6 | 7 | import js from "react-syntax-highlighter/dist/cjs/languages/hljs/javascript"; 8 | import py from "react-syntax-highlighter/dist/cjs/languages/hljs/python"; 9 | import sql from "react-syntax-highlighter/dist/cjs/languages/hljs/sql"; 10 | 11 | interface Props { 12 | lang: "js" | "sql" | "py"; 13 | startingLineNumber?: number; 14 | hideCopy?: boolean; 15 | className?: string; 16 | children?: string; 17 | size?: "small" | "medium" | "large"; 18 | } 19 | 20 | function CodeBlock(props: Props) { 21 | let lang = props.lang 22 | ? props.lang 23 | : props.className 24 | ? props.className.replace("language-", "") 25 | : "js"; 26 | // force jsx to be js highlighted 27 | if (lang === "jsx") lang = "js"; 28 | 29 | SyntaxHighlighter.registerLanguage("js", js); 30 | SyntaxHighlighter.registerLanguage("py", py); 31 | SyntaxHighlighter.registerLanguage("sql", sql); 32 | 33 | // const large = props.size === 'large' ? true : false 34 | const large = false; 35 | 36 | return ( 37 |
38 | 65 | {props.children} 66 | 67 | {!props.hideCopy && props.children ? ( 68 |
69 | 70 | 77 | 78 |
79 | ) : null} 80 |
81 | ); 82 | } 83 | 84 | export default CodeBlock; 85 | -------------------------------------------------------------------------------- /components/CodeSample.tsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import ComponentIndex, { RawComponents } from "./ComponentIndex"; 3 | 4 | // /* eslint import/no-webpack-loader-syntax: off */ 5 | import CodeBlock from "./CodeBlock/CodeBlock"; 6 | 7 | // import Frame from "react-frame-component"; 8 | 9 | interface Props { 10 | children: any; 11 | code: any; 12 | sample: string; 13 | } 14 | 15 | function CodeSample(props: Props) { 16 | // console.log(props.sample); 17 | 18 | // @ts-ignore 19 | const Sample = ComponentIndex[props.sample]; 20 | // console.log(Sample); 21 | // console.log(props.children); 22 | 23 | if (!process.browser) { 24 | return Loading; 25 | } else { 26 | // console.log("hello"); 27 | if (document) { 28 | // const head = document.head; 29 | 30 | // console.log(document.head.innerHTML); 31 | // @ts-ignore 32 | // console.log(typeof head); 33 | // @ts-ignore 34 | // let initialContent = `
`; 35 | return ( 36 | <> 37 |
38 |
39 | {/* */} 45 | 46 | {/* */} 47 | {/* */} 55 | {/*