All Projects → nstudio → Nativescript Cardview

nstudio / Nativescript Cardview

Licence: mit
♦️ ♣️ NativeScript widget for Material Design CardView

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Nativescript Cardview

Materialdesignsamples
Material Design 系列控件samples,讲了Material Design 系列新控件的使用方法和一些场景示例,使用详情请看对应博客,持续更新中...
Stars: ✭ 900 (+222.58%)
Mutual labels:  material-design, cardview
Android Cards
CardView with Material Design using ConstraintLayout
Stars: ✭ 136 (-51.25%)
Mutual labels:  material-design, cardview
Tc Material Design
Série de artigos sobre o Material Design Android
Stars: ✭ 64 (-77.06%)
Mutual labels:  material-design, cardview
Nativescript Floatingactionbutton
Material Design Floating Action Button in NativeScript apps.
Stars: ✭ 133 (-52.33%)
Mutual labels:  nativescript, material-design
Cardview
Material Design Cards ? How cool is that !
Stars: ✭ 101 (-63.8%)
Mutual labels:  material-design, cardview
Rwa Trivia
Trivia App - Real World Angular series
Stars: ✭ 251 (-10.04%)
Mutual labels:  nativescript, material-design
Ej2 Javascript Ui Controls
Syncfusion JavaScript UI controls library offer more than 50+ cross-browser, responsive, and lightweight HTML5 UI controls for building modern web applications.
Stars: ✭ 256 (-8.24%)
Mutual labels:  material-design
Laravel Material Design
Laravel 5.6 on Material Design Lite 1.3 with user authentication, registration with email confirmation, social media authentication, password recovery, and captcha protection. This makes full use of Controllers for the routes, templates for the views, and makes use of middleware for routing. Uses laravel ORM modeling and has CRUD (Create Read Update Delete) functionality for all tasks. Quick setup, can be done in 5 minutes. It will take longer to obtain your Facebook, Twitter, and Google Plus API Keys than it will to set this up.
Stars: ✭ 263 (-5.73%)
Mutual labels:  material-design
Godot Go
Go language bindings for the Godot Engine's GDNative API.
Stars: ✭ 254 (-8.96%)
Mutual labels:  nativescript
Material Playground
Polymer material design playground
Stars: ✭ 254 (-8.96%)
Mutual labels:  material-design
Rubik
Material Design 风格的 Vue.js UI 组件库
Stars: ✭ 277 (-0.72%)
Mutual labels:  material-design
Githubfollows
A demo project based on MVVM architecture and material design & animations.
Stars: ✭ 272 (-2.51%)
Mutual labels:  material-design
Epiboard
Web Extension — A new tab page extension with material design and useful features 🆕 🎉
Stars: ✭ 262 (-6.09%)
Mutual labels:  material-design
T Mvp
Android AOP Architecture by Apt, AspectJ, Javassisit, based on Realm+Databinding+MVP+Retrofit+Rxjava2
Stars: ✭ 2,740 (+882.08%)
Mutual labels:  material-design
Material Design Avatars
Create material deisgn avatars for users just like Google Messager. It may not be unique but looks better than Identicon or Gravatar.
Stars: ✭ 266 (-4.66%)
Mutual labels:  material-design
Materiallettericon
Material first letter icon like lollipop contacts icon. Letter(s) on a shape drawn on canvas.
Stars: ✭ 255 (-8.6%)
Mutual labels:  material-design
Laravel Angular Cms
CMS built on Laravel, AngularJS and Material Design
Stars: ✭ 272 (-2.51%)
Mutual labels:  material-design
Get Me Through
A Free, Offline, Real-Time, Open-source web-app to assist organisers of any event in allowing only authorised/invited people using Face-Recognition Technology or QR Code.
Stars: ✭ 255 (-8.6%)
Mutual labels:  material-design
Ticktockmusic
Material Design Music Player
Stars: ✭ 262 (-6.09%)
Mutual labels:  material-design
Angular Native Seed
Build web apps and NativeScript applications from one codebase using the AngularCLI.
Stars: ✭ 271 (-2.87%)
Mutual labels:  nativescript

NativeScript CardView

A NativeScript plugin to provide an XML widget to implement the Material Design CardView component.

npm npm


Installation

NativeScript 7+:

ns plugin add @nstudio/nativescript-cardview

NativeScript prior to 7:

tns plugin add @nstudio/[email protected]

Material Design Card Spec
CardView Android Documentation

Usage

iOS note: Setting a background-color will help if you do not see the card on the page.

NativeScript Plain

IMPORTANT: Make sure you include xmlns:Card="@nstudio/nativescript-cardview" on the Page element

XML

<Page xmlns:Card="@nstudio/nativescript-cardview">
   <StackLayout>
      <Card:CardView class="cardStyle" margin="10" elevation="40" radius="5">
           <grid-layout rows="200, auto, auto" columns="auto, auto, *">
               <image src="~/images/batman.jpg" stretch="aspectFill" colSpan="3" row="0" />
               <label text="Batman wants to be friends?" class="info" textWrap="true" row="1" colSpan="3" />
               <button text="DECLINE" tap="goAway" row="2" col="0" />
               <button text="ACCEPT" row="2" col="1" />
           </grid-layout>
       </Card:CardView>
   </StackLayout>
</Page>

CSS

.cardStyle {
  background-color: #3489db;
  color: #fff;
}

NativeScript Angular

import { registerElement } from '@nativescript/angular';
import { CardView } from '@nstudio/nativescript-cardview';
registerElement('CardView', () => CardView);
<CardView class="cardStyle" margin="10" elevation="40" radius="1">
  <GridLayout rows="10,30,30,250, auto, auto,10" columns="10,40, *, 30,10">
    <image
      src="res://profile"
      stretch="aspectFit"
      verticalAlignment="stretch"
      col="1"
      row="1"
      rowSpan="2"
    ></image>
    <label
      class="createdBy text-left"
      horizontalAlignment="left"
      [text]="item.CreatedBy"
      row="1"
      col="2"
      textWrap="true"
    ></label>
    <label
      class="createdOn text-left"
      horizontalAlignment="left"
      [text]="item.UpdatedDate"
      row="2"
      col="2"
    ></label>
    <image
      [src]="'https://img.youtube.com/vi/'+item.MediaURL+'/mqdefault.jpg'"
      stretch="aspectFit"
      colSpan="3"
      col="1"
      row="3"
    ></image>
    <label
      horizontalAlignment="left"
      [text]="item.Title"
      colSpan="3"
      row="4"
      textWrap="true"
      col="1"
    ></label>
    <label
      horizontalAlignment="left"
      [text]="item.Summary"
      textWrap="true"
      col="1"
      row="5"
      colSpan="3"
    ></label>
  </GridLayout>
</CardView>

NativeScript Vue

import Vue from 'nativescript-vue';
Vue.registerElement(
  'CardView',
  () => require('@nstudio/nativescript-cardview').CardView
);
<card-view margin="10" elevation="40" radius="1">
  <stack-layout>
    <label text="Hello World"></label>
  </stack-layout>
</card-view>

Attributes

  • radius optional

An attribute to control the 'border-radius' of the card.

Platform specific options

Android

  • elevation optional

An attribute to set the elevation of the card. This will increase the 'drop-shadow' of the card. There can be some performance impact when using a very high elevation value.

  • ripple optional

Set to 'true' to show a ripple when the card is tapped. Tap event handlers in the card content will prevent the ripple.

iOS

  • shadowOffsetWidth optional

An attribute to offset the x position of the shadow behind the card.

  • shadowOffsetHeight optional

An attribute to offset the y position of the shadow behind the card.

  • shadowColor optional

An attribute to set the color of the shadow behind the card.

  • shadowOpacity optional

An attribute to set the opacity of the shadow behind the card.

  • shadowRadius optional

An attribute to set the radius of the shadow (shadow spread) behind the card.

The default values are set to:

radius = 2;
shadowOffsetWidth = 0;
shadowOffsetHeight = 2;
shadowColor = new Color('#000').ios
shadowOpacity = 0.4;
shadowRadius = 1;

Sample Screenshots

Android

Sample 1 Sample 2
Sample1 Sample2

iOS

Sample 1 Sample 2
Sample1 Sample2

Run Demo

git clone https://github.com/nstudio/nativescript-cardview.git

npm run demo.ios

// or...

npm run demo.android

Changelog

Contributing

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].