From d6f65516ad9dfff72641fccea79b596e6f42b3c3 Mon Sep 17 00:00:00 2001 From: Eric Fennis Date: Tue, 1 Feb 2022 19:26:07 +0100 Subject: [PATCH] Add documentation Section to lucide.dev (#479) * Add docs Menu Tree data * Start with sectiontitles * Create link list * Add Docs menu to mobile * Add some more pages and text * Optimize text * add license to the menu * update packages * Fix build * Update title * Remove ModifiedTooltip * Fix assets * add yarn to copy-assets command * update lockfile --- .vscode/settings.json | 7 + docs/FIGMA_GUIDE.md | 7 + docs/ICON_DESIGN_GUIDE.md | 6 +- docs/ILLUSTRATOR_GUIDE.md | 5 +- docs/INKSCAPE_GUIDE.md | 4 + docs/comparison.md | 25 + docs/index.md | 113 +- docs/installation.md | 110 +- docs/packages/lucide-preact.md | 2 +- docs/packages/lucide-static.md | 2 +- docs/packages/lucide-vue-next.md | 30 +- docs/packages/lucide-vue.md | 12 +- site/.gitignore | 1 + site/package.json | 3 +- site/src/components/CopyButton.tsx | 11 +- site/src/components/DocsMenu.tsx | 52 + site/src/components/Header.tsx | 4 +- site/src/components/HeadingAnchored.tsx | 4 +- .../components/HeadingNavigationProvider.tsx | 20 +- site/src/components/HeadingTreeMenu.tsx | 9 +- site/src/components/IconDetailOverlay.tsx | 5 + site/src/components/IconList.tsx | 74 +- site/src/components/IconListItem.tsx | 61 + site/src/components/Layout.tsx | 46 +- site/src/components/MobileMenu.tsx | 38 +- .../components/MobileNavigationProvider.tsx | 20 +- site/src/components/Package.tsx | 69 +- site/src/lib/docsMenuTree.ts | 128 + site/src/lib/mdxComponents.tsx | 21 +- site/src/lib/theme.tsx | 16 + site/src/pages/_app.tsx | 2 +- site/src/pages/docs/[docName].tsx | 36 +- site/src/pages/docs/index.tsx | 51 +- site/src/pages/icon/[iconName].tsx | 15 +- site/src/pages/index.tsx | 11 +- site/src/pages/license.tsx | 57 + site/src/pages/packages/index.tsx | 10 +- site/yarn.lock | 2487 +++++++++-------- 38 files changed, 2086 insertions(+), 1488 deletions(-) create mode 100644 .vscode/settings.json create mode 100644 docs/FIGMA_GUIDE.md create mode 100644 docs/comparison.md create mode 100644 site/.gitignore create mode 100644 site/src/components/DocsMenu.tsx create mode 100644 site/src/components/IconListItem.tsx create mode 100644 site/src/lib/docsMenuTree.ts create mode 100644 site/src/pages/license.tsx diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 000000000..9e7294402 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,7 @@ +{ + "cSpell.words": [ + "devs", + "preact", + "Preact" + ] +} diff --git a/docs/FIGMA_GUIDE.md b/docs/FIGMA_GUIDE.md new file mode 100644 index 000000000..c1b7c4c52 --- /dev/null +++ b/docs/FIGMA_GUIDE.md @@ -0,0 +1,7 @@ +--- +title: Figma Template Guide +--- + +# Figma Template Guide + +Please help us write this guide. diff --git a/docs/ICON_DESIGN_GUIDE.md b/docs/ICON_DESIGN_GUIDE.md index 6bf1fb28c..0ff63a2f0 100644 --- a/docs/ICON_DESIGN_GUIDE.md +++ b/docs/ICON_DESIGN_GUIDE.md @@ -1,4 +1,8 @@ -# Icon Design Guide +--- +title: Icon Design Guide +--- + +# Icon Design Principles Here are rules that should be followed to keep quality and consistency when making icons for Lucide. diff --git a/docs/ILLUSTRATOR_GUIDE.md b/docs/ILLUSTRATOR_GUIDE.md index 969239b8e..4f11ae4ce 100644 --- a/docs/ILLUSTRATOR_GUIDE.md +++ b/docs/ILLUSTRATOR_GUIDE.md @@ -1,3 +1,6 @@ +--- +title: Illustrator Template Guide +--- # Illustrator Template Guide @@ -25,4 +28,4 @@ The Illustrator template is created following guidelines from the [Icon Design G After that, double check that the [code conventions and SVG global attributes](https://github.com/lucide-icons/lucide/blob/master/docs/ICON_DESIGN_GUIDE.md#code-conventions) are correct. -7. Minify paths with [SVGOMG](https://jakearchibald.github.io/svgomg/). \ No newline at end of file +7. Minify paths with [SVGOMG](https://jakearchibald.github.io/svgomg/). diff --git a/docs/INKSCAPE_GUIDE.md b/docs/INKSCAPE_GUIDE.md index 05d10ac59..d1587f067 100644 --- a/docs/INKSCAPE_GUIDE.md +++ b/docs/INKSCAPE_GUIDE.md @@ -1,3 +1,7 @@ +--- +title: Icon Design Guide +--- + # Inkscape Setup Guide This guide shows the steps to setup Inkscape for creating icons that conform to the Featherity design diff --git a/docs/comparison.md b/docs/comparison.md new file mode 100644 index 000000000..b27f6a8e3 --- /dev/null +++ b/docs/comparison.md @@ -0,0 +1,25 @@ +--- +title: Comparison +--- + +# Comparison + +## Lucide vs Feather Icons + +Lucide is a community-run fork of [Feather Icons](https://github.com/feathericons/feather). + +It began after growing disaffection of the [Feather Icons](https://github.com/feathericons/feather) project moderation. With over 300+ open issues and over 100+ open PRs, the Feather Icons project has been abandoned adn not maintained actively. This unfortunately means that hundreds of developers and designers wasted their time contributing to Feather Icons with no chance of PRs being accepted. + +Lucide is trying to expand the icon set as much as possible while staying faithful to the original simplistic design language. We do this as a community of devs and designers. + +### Why should I choose Lucide over Feather Icons? + +- Lucide already expended the icon set by 130+ in less then a year. Lucide has over 500+ icon, feather sticks around 286 icons. +- Well maintained code base. +- Active community. + +### Should I migrate to Lucide? + +That depends if you're fine with the icons from feather icons. If that is the case, it is maybe not the effort worth it. +But if you keep wrestling and feel limited by the icons Feather provides you can consider to migrate. +We didn't remove any icons when we forked, but there are some icons renamed. diff --git a/docs/index.md b/docs/index.md index 19183afb9..9b5bba8e5 100644 --- a/docs/index.md +++ b/docs/index.md @@ -1,116 +1,23 @@ --- title: Introduction +nextPage: + - comparison + - installation --- # Introduction -## What is Lucide? +An open source icon library for displaying icons and symbols in digital and non digital projects. It is containing over 500+ Vector (svg) files. To use these icons, lucide provides several official packages to make it easier to use these icons in projects. -Lucide is a community-run fork of [Feather Icons](https://github.com/feathericons/feather), open for anyone to contribute icons. +Lucide contains icons with different variants and states. With that designers and developers can choose the right icon for them selves. If icons don't exist you're free to open design request. The Lucide community will help. -It began after growing disaffection of the [Feather Icons](https://github.com/feathericons/feather) project moderation. With over 300+ open issues and over 100+ open PRs, the Feather Icons project has been abandoned. This unfortunately means that hundreds of developers and designers wasted their time contributing to Feather Icons with no chance of PRs being accepted. +With help of the community, contributors are providing the library of new icons. With more icons, we simply have more icons to work with in your project. Also with rising of new applications with specific features lucide has the goal the provide the complete set for you project. -Lucide is trying to expand the icon set as much as possible while staying faithful to the original simplistic design language. We do this as a community of devs and designers and hope that you'll join us! +When designing new icons, the community is working with a set of design rules. This is to keep icons: recognizable, consistency in style, and readable on all sizes. The community likes to have creativity in new icons but conventional design is important to have recognizable icons. -### Why choose Lucide over Feather Icons +Beside design, code is also important. Assets like icons in for example web projects can increase the transferred bytes significantly. With the growing internet, lucide has the responsibility to keep their assets small as possible. To achieve this, lucide uses SVG compression and specific code architecture for three-shaking abilities. With three-shaking used you will only ship the icons you used, helps you to keep the software small as possible when distributed. -- Lucide already expended the icon set by 130+ in less then a year, so more icons to work with. -- Well maintained code base. -- Active community. +Lucide provides several official packages for: [Web (Vanilla)](https://lucide.dev/docs/lucide), [React](https://lucide.dev/docs/lucide-react), [Vue](https://lucide.dev/docs/lucide-vue), [Vue 3](https://lucide.dev/docs/lucide-vue-next), [Preact](https://lucide.dev/docs/lucide-preact), [Angular](https://lucide.dev/docs/lucide-angular), [NodeJS](https://lucide.dev/docs/lucide-static#nodejs) and [Flutter](https://lucide.dev/docs/lucide-flutter). -## Getting Started - -At its core, Lucide is a collection of [SVG](https://svgontheweb.com/#svg) files. This means that you can use Lucide icons in all the same ways you can use SVGs (e.g. `img`, `background-image`, `inline`, `object`, `embed`, `iframe`). Here's a helpful article detailing the many ways SVGs can be used on the web: [SVG on the Web – Implementation Options](https://svgontheweb.com/#implementation) - -### Using Lucide packages - -### Web - -Implementation of the lucide icon library for web applications. - -```sh -npm install lucide - -#or - -yarn add lucide -``` - -For more details, see the [documentation](lucide). - -### React - -Implementation of the lucide icon library for react applications. - -```sh -yarn add lucide-react - -# or - -npm install lucide-react -``` - -For more details, see the [documentation](lucide-react). - -### Vue 2 - -Implementation of the lucide icon library for vue applications. - -```sh -yarn add lucide-vue - -# or - -npm install lucide-vue -``` - -For more details, see the [documentation](lucide-vue). - -### Vue 3 - -Implementation of the lucide icon library for vue applications. - -```sh -yarn add lucide-vue-next - -# or - -npm install lucide-vue-next -``` - -For more details, see the [documentation](lucide-vue-next). - -### Angular - -```sh -yarn add lucide-angular - -# or - -npm install lucide-angular -``` - -For more details, see the [documentation](lucide-angular). - -### Preact - -Implementation of the lucide icon library for preact applications. - -```sh -yarn add lucide-preact - -# or - -npm install lucide-preact -``` - -For more details, see the [documentation](lucide-preact). - -### Figma - -The lucide figma plugin. - -Visit [Figma community page](https://www.figma.com/community/plugin/939567362549682242/Lucide-Icons) to install the plugin. - -![Figma Lucide Cover](https://www.figma.com/community/plugin/939567362549682242/thumbnail "Figma Lucide Cover") +Any questions about lucide? Ask the community. Active on [GitHub](https://github.com/lucide-icons/lucide) and [Discord](https://discord.gg/EH6nSts). diff --git a/docs/installation.md b/docs/installation.md index 1a3be4487..430dedd12 100644 --- a/docs/installation.md +++ b/docs/installation.md @@ -4,10 +4,112 @@ title: Installation # Installation -Hello +## Web -> hello +Implementation of the lucide icon library for web applications. -```js -console.log('asdadfasdf') +```sh +npm install lucide + +#or + +yarn add lucide ``` + +For more details, see the [documentation](packages/lucide). + +## React + +Implementation of the lucide icon library for react applications. + +```sh +yarn add lucide-react + +# or + +npm install lucide-react +``` + +For more details, see the [documentation](https://github.com/lucide-icons/lucide/tree/master/packages/lucide-react#lucide-react). + +## Vue 2 + +Implementation of the lucide icon library for vue applications. + +```sh +yarn add lucide-vue + +# or + +npm install lucide-vue +``` + +For more details, see the [documentation](https://github.com/lucide-icons/lucide/tree/master/packages/lucide-vue#lucide-vue). + +## Vue 3 + +Implementation of the lucide icon library for vue applications. + +```sh +yarn add lucide-vue-next + +# or + +npm install lucide-vue-next +``` + +For more details, see the [documentation](https://github.com/lucide-icons/lucide/tree/master/packages/lucide-vue-next#lucide-vue-next). + +## Angular + +```sh +yarn add lucide-angular + +# or + +npm install lucide-angular +``` + +For more details, see the [documentation](https://github.com/lucide-icons/lucide/tree/master/packages/lucide-angular#lucide-angular). + +## Preact + +Implementation of the lucide icon library for preact applications. + +```sh +yarn add lucide-preact + +# or + +npm install lucide-preact +``` + +For more details, see the [documentation](https://github.com/lucide-icons/lucide/tree/master/packages/lucide-preact#lucide-preact). + +## Figma + +The lucide figma plugin. + +Visit [Figma community page](https://www.figma.com/community/plugin/939567362549682242/Lucide-Icons) to install the plugin. + +![Setting Page Size](https://www.figma.com/community/plugin/939567362549682242/thumbnail "Figma Lucide Cover") + +## Laravel + +Implementation of Lucide icon's using `blade-icons` for Laravel based projects. + +```sh +composer require mallardduck/blade-lucide-icons +``` + +For more details, see the [documentation](https://github.com/mallardduck/blade-lucide-icons/blob/main/README.md). + +## Flutter + +Implementation of Lucide icon library for Flutter applications. + +```sh +flutter pub add lucide_icons +``` + +For more details, see the [pub.dev](https://pub.dev/packages/lucide_icons). diff --git a/docs/packages/lucide-preact.md b/docs/packages/lucide-preact.md index 4ba8f13b3..8f185e8ff 100644 --- a/docs/packages/lucide-preact.md +++ b/docs/packages/lucide-preact.md @@ -62,7 +62,7 @@ const App = () => { It is possible to create one generic icon component to load icons. -> :warning: Example below importing all EsModules, caution using this example, not recommended when you using bundlers, your application build size will grow strongly. +> ⚠️ Example below importing all EsModules, caution using this example, not recommended when you using bundlers, your application build size will grow strongly. #### Icon Component Example diff --git a/docs/packages/lucide-static.md b/docs/packages/lucide-static.md index 5b7c04b3b..16cf2d660 100644 --- a/docs/packages/lucide-static.md +++ b/docs/packages/lucide-static.md @@ -11,7 +11,7 @@ This package include the following lucide implementations: This package is suitable for very specific use cases for example if you want to use icon fonts, svg sprites, normal svgs or Common.js Svg strings in your javascript project. -> ⚠️ It is not recommended to use this package for svg sprites or icon fonts for web pages/applications, for prototyping it is ok. We recommend to bundlers for web applications to make sure you only bundle the used icons from this icon library (Threeshaking). Otherwise it will load all the icons, making you webpage loading slower. Threeshaking is only available in the packages: [lucide](https://github.com/lucide-icons/lucide/tree/master/packages/lucide), [lucide-react](https://github.com/lucide-icons/lucide/tree/master/packages/lucide-react), [lucide-vue](https://github.com/lucide-icons/lucide/tree/master/packages/lucide-vue), [lucide-vue-next](https://github.com/lucide-icons/lucide/tree/master/packages/lucide-vue-next), [lucide-angular](https://github.com/lucide-icons/lucide/tree/master/packages/lucide-angular), [lucide-preact](https://github.com/lucide-icons/lucide/tree/master/packages/lucide-preact) +> ⚠️ It is not recommended to use this package for svg sprites or icon fonts for web pages/applications, for prototyping it is ok. We recommend to bundlers for web applications to make sure you only bundle the used icons from this icon library (Threeshaking). Otherwise it will load all the icons, making you webpage loading slower. Threeshaking is only available in the packages: [lucide](lucide), [lucide-react](lucide-react), [lucide-vue](lucide-vue), [lucide-vue-next](lucide-vue-next), [lucide-angular](lucide-angular), [lucide-preact](lucide-preact) ## Installation diff --git a/docs/packages/lucide-vue-next.md b/docs/packages/lucide-vue-next.md index 3f5aeee02..2d6bdb370 100644 --- a/docs/packages/lucide-vue-next.md +++ b/docs/packages/lucide-vue-next.md @@ -2,15 +2,19 @@ Implementation of the lucide icon library for Vue 3 applications. -> ⚠️ This version of lucide is for Vue 3, For Vue 2 got to [lucide-vue-next](https://github.com/lucide-icons/lucide/tree/master/packages/lucide-vue#lucide-vue) +> ⚠️ This version of lucide is for Vue 3, For Vue 2 got to [lucide-vue-next](lucide-vue) ## Installation -```sh +**With yarn** + +```bash yarn add lucide-vue-next +``` -# or +**With npm** +```bash npm install lucide-vue-next ``` @@ -23,7 +27,7 @@ Each icon can be imported as a vue component. You can pass additional props to adjust the icon. -``` vue +``` html @@ -66,11 +70,11 @@ You can also pass custom props that will be added in the svg as attributes. It is possible to create one generic icon component to load icons. -> :warning: Example below importing all EsModules, caution using this example, not recommended when you using bundlers, your application build size will grow strongly. +> ⚠️ Example below importing all EsModules, caution using this example, not recommended when you using bundlers, your application build size will grow strongly. #### Icon Component Example -``` vue +``` html @@ -85,18 +89,18 @@ export default { required: true, }, }, - computed: { - icon() { - return icons[this.name]; - }, - }, + setup(props) { + const icon = computed(() => icons[props.name]) + + return { icon } + } }; ``` ##### Then you can use it like this -``` vue +``` html