Code Monkey home page Code Monkey logo

elephant-ui's Introduction

ElephantUI

Usage

See contents of the directory src/components/ui for available components.

See shadcn/UI documentation for usage of available components โ€” or when necessary the local showroom possibilities as described below.

Install in your project using npm i @ttab/elephant-ui

Build styles

In the project in which you are using elephant-ui add the following:

tailwind.config.ts

import preset from '@ttab/elephant-ui/styles/preset'
export default {
  presets: [preset],
  content: [
    './src/**/*.{html,tsx}',
    './node_modules/@ttab/elephant-ui/dist/src/components/ui/*.js'
  ],
  theme: {
    extend: {}
  },
  plugins: []
} satisfies Config

This will add the needed preset from elephant-ui and add the needed paths to the content array.

input.css

@import '@ttab/elephant-ui/dist/styles/layout-base.css';

@tailwind base;
@tailwind components;
@tailwind utilities;

This will import the needed base styles from elephant-ui and add the needed tailwind directives.

Import

// Components
import { Button } from '@ttab/elephant-ui'
// Icons
import { Waves } from '@ttab/elephant-ui/icons'
// Utils
import { cn } from '@ttab/elephant-ui/lib/utils'

Icons

Icons are from lucide-react.

Adding additional components

See available components at shadcn/UI documentation.

  1. Use for example npx shadcn-ui@latest add accordion to add an accordion.
  2. Open the src/components/ui/accordion.tsx file and change import of cn to be import { cn } from "@/lib/utils".

Showcasing components during development

Add component examples and usage in src/showroom/components and import into ``src/showroom/app.tsx`.

Run npm run dev and open given url in your local browser to see example of how we could have a local testbed while developing.

This might not be necessary unless we change the shadcn/ui default code/usage. And on the other hand it might not be sufficient in the future...

elephant-ui's People

Contributors

dannelundqvist avatar dependabot[bot] avatar gularsson avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Forkers

dimelords

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.