Coder Social home page Coder Social logo

novatextcard's Introduction

Nova Text Card

A custom card for Laravel Nova to show Text in cards with some good options.

preview

Installation

You can install the package in to a Laravel app that uses Nova via composer:

composer require ericlagarda/nova-text-card

Then, register your new link in the cards method of the NovaServiceProvider or your ResourceTool class.

public function cards()
{
    return [
        // ...
        // Examples from the preview image
 
        (new TextCard())
            ->forceFullWidth()
            ->heading('My custom awesome heading')
            ->text('Congue platea augue fames nullam morbi vehicula egestas lobortis lacus adipiscing eleifend'),

        (new TextCard())
            ->width('1/2')
            ->height(100)
            ->center(false)
            ->heading('Custom card no centered')
            ->text('Congue platea augue fames nullam morbi'),

        (new TextCard())
            ->width('1/2')
            ->height()
            ->text('<h4 class="font-light">This is a custom card with text and no heading. Height is set to auto.</h4>')
            ->textAsHtml(),

        (new TextCard())
            ->forceFullWidth()
            ->height(90)
            ->heading('<h1 class="text-3xl text-80 font-light">Just a heading text with a smile <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path class="fill-current" d="M12 2c5.514 0 10 4.486 10 10s-4.486 10-10 10-10-4.486-10-10 4.486-10 10-10zm0-2c-6.627 0-12 5.373-12 12s5.373 12 12 12 12-5.373 12-12-5.373-12-12-12zm6 14h-12c.331 1.465 2.827 4 6.001 4 3.134 0 5.666-2.521 5.999-4zm0-3.998l-.755.506s-.503-.948-1.746-.948c-1.207 0-1.745.948-1.745.948l-.754-.506c.281-.748 1.205-2.002 2.499-2.002 1.295 0 2.218 1.254 2.501 2.002zm-7 0l-.755.506s-.503-.948-1.746-.948c-1.207 0-1.745.948-1.745.948l-.754-.506c.281-.748 1.205-2.002 2.499-2.002 1.295 0 2.218 1.254 2.501 2.002z"/></svg></h1>')
            ->headingAsHtml(),
    ];
}

Card options

  • ->width('string'): Width of the card.
  • ->forceFullWidth(): Force the card to be full width. A fix for nova cards order.
  • ->height('string or number'):Height of the Card. If is called without options height will be auto. Default to nova card height.
  • ->center(boolean): If you want the text centered or not. Default to true
  • ->heading('string or html'): Heading text or custom html. Default to false. No heading text is shown.
  • ->text('string or html'): Text of the card or custom html. Default to false. No text is shown.
  • ->headingAsHtml(): If you want to print the heading as HTML
  • ->textAsHtml(): If you want to print the text as HTML

novatextcard's People

Contributors

4ice avatar krato avatar theofanisv avatar tumainimosha 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.