Coder Social home page Coder Social logo

ikbhal / tailwind-editor Goto Github PK

View Code? Open in Web Editor NEW

This project forked from fouita/tailwind-editor

0.0 0.0 0.0 131 KB

notion like tailwindcss editor built with svelte

Home Page: https://editor-tw.fouita.com/

License: MIT License

JavaScript 3.42% Svelte 96.40% CSS 0.18%

tailwind-editor's Introduction

Tailwind Editor

Svelte component to generate tailwindcss html from a notion like wysiwyg editor.

This component is under development, don't use it in production yet!

svelte tailwind wysiwyg editor

Installation

$npm i tailwind-editor

Import to use in a svelte project, you need also tailwind installed (or imported) in order for this to work

<script>
    import Editor from 'tailwind-editor'
    let html = ''
</script>

<div class="flex">
    <Editor bind:html={html} />
    <div>
        {html}
    </div>
</div>

Add initial HTML

If you want to add custom html when you load the component you can pass an array of elements like the following

this is not recommended if the code is not previously generated by the editor

<script>
    import Editor from 'tailwind-editor'
    let arr_html = [
        {html: 'Hello <span class="font-bold">world!</span>', klass: 'p-2 text-3xl'}
    ]
    let html = ''
</script>

<Editor bind:html={html} {arr_html} editable />

TODO

  1. embed media (image, video)
  2. add lists
  3. drag and drop positions
  4. code highlighter with tailwindcss

Contribution

All contribution are welcome!

About

Fouita : UI framework for svelte + tailwind components

tailwind-editor's People

Contributors

haynajjar avatar rotimi-best avatar

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.