Git Product home page Git Product logo

svelte-grid-responsive's Introduction

Svelte Grid Responsive

npm versionLicense: MITBuild StatusNetlify Status

Responsive grid system based on Bootstrap for Svelte.

Installation

npm i svelte-grid-responsive
// OR
yarn add svelte-grid-responsive

Note: to use this library in sapper, install as devDependency. See the link.

Demo Link

Local demo:

git clone https://github.com/andrelmlins/svelte-grid-responsive.git
cd svelte-grid-responsive
npm install && npm run dev

Examples

An example of how to use the library:

<script>
  import Grid from "svelte-grid-responsive";
</script>

<Grid container gutter={12}>
  <Grid xs={12} md={4} lg={3}>
    xs=12 md=4 lg=3
  </Grid>
  <Grid xs={12} md={4} lg={3}>
    xs=12 md=4 lg=3
  </Grid>
  <Grid xs={12} md={4} lg={3}>
    xs=12 md=4 lg=3
  </Grid>
  <Grid xs={12} md={4} lg={3}>
    xs=12 md=4 lg=3
  </Grid>
</Grid>

Properties

Component props:

Prop Default Type Description
container false bool Defines whether the grid is a container
gutter null number Grid spacing in the container
columns 12 number Setting columns count in the container
order null number Order the columns
xs null number Size in extra small screen
sm null number Size in small screen
md null number Size in medium screen
lg null number Size in large screen
xl null number Size in extra large screen
xsOffset null number Offset in extra small screen
smOffset null number Offset in small screen
mdOffset null number Offset in medium screen
lgOffset null number Offset in large screen
xlOffset null number Offset in extra large screen

NPM Statistics

Download stats for this NPM package

NPM

License

Svelte Grid Responsive is open source software licensed as MIT.

svelte-grid-responsive's People

Contributors

alkanna avatar andrelmlins avatar dependabot[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

svelte-grid-responsive's Issues

Typescript definitions, optionals

If using typescript, the demo example code won't work right. All of the properties on interface GridProps are required. I am thinking only a couple should be required and all else should be marked as optional.

is it possible to order elements

Hi, nice lib :)

bootstrap offers a way to order elements in the grid. I looked at the source code I haven't found this functionality. Maybe I overlooked it. So it is possible to order elements?

If no would it be possible to add this functionality to the lib?

Spread $$restProps to container

Hey, would it have any undesirable side-effect to spread other props to the main div ?
For instance, I want to add the align-items: center css property to it, but as it is right now, I don't see any other way to do it.

The following packages have a svelte field in their package.json but no exports condition for svelte.

Description

23:55:01 [vite-plugin-svelte] WARNING: The following packages have a svelte field in their package.json but no exports condition for svelte.

[email protected]

Please see https://github.com/sveltejs/vite-plugin-svelte/blob/main/docs/faq.md#missing-exports-condition for details.

Steps to check or reproduce

Run npm install in a project with the latest "svelte-grid-responsive": "^1.2.4", and "@sveltejs/vite-plugin-svelte": "^3.0.2",.

Potential fix

As usual with deprecation warnings like this the migration path is rather unclear. It looks like you need to change:

{
	"svelte": "./dist/index.js",
        "types": "./dist/index.d.ts"
}

To a construction like this (or actually you need to have both, since some tools are not compatible with this yet 🤦🏻‍♂️):

{
	"exports": {
		".": {
			"types": "./dist/index.d.ts",
			"svelte": "./dist/index.js"
		}
	}
}

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.