Open In App

ReactJS Semantic UI Card Views

Semantic UI is a modern framework used in developing seamless designs for the website, It gives the user a lightweight experience with its components. It uses the predefined CSS, JQuery language to incorporate in different frameworks.

In this article we will see how to use card views in ReactJS Semantic UI.



Properties:

Syntax:



<card>
  <card.content>
  </card.content>
</card>

 

Creating React Application And Installing Module:

Project Structure: It will look like the following.

Step to Run Application: Run the application  from the root directory of the project, using the following command.

npm start

Example 1: In this example, we will be going to use card, image, and icon elements to display basic card content with image,  meta, and icon by using ReactJS Semantic UI Card Views.




import React from 'react'
import { Card, Image, Icon } from 'semantic-ui-react'
  
const styleLink = document.createElement("link");
styleLink.rel = "stylesheet";
styleLink.href = 
document.head.appendChild(styleLink);
  
const btt = () => (
<Card>
    <Image src=
    <Card.Content>
      <Card.Header>GeeksforGeeks</Card.Header>
      <Card.Meta>
        <span>Found is 2008</span>
      </Card.Meta>
    </Card.Content>
    <Card.Content extra>
        <Icon name='react' />
        ReactJS
    </Card.Content>
  </Card>
)
  
export default btt

Output: 

Example 2: In this example, we will be going to use the card, image, and icon elements to display a group of cards with content property extra by using ReactJS Semantic UI Card Views.




import React from 'react'
import { Card, Image, Icon } from 'semantic-ui-react'
  
const styleLink = document.createElement("link");
styleLink.rel = "stylesheet";
styleLink.href = 
document.head.appendChild(styleLink);
  
const btt = () => (
<Card.Group>
  <Card fluid>
    <Image src=
    <Card.Content>
      <Card.Header>GeeksforGeeks</Card.Header>
    </Card.Content>
    <Card.Content extra>
        <Icon name='react' />
        ReactJS
    </Card.Content>
  </Card>
  <Card fluid>
    <Image src=
    <Card.Content>
      <Card.Header>GeeksforGeeks</Card.Header>
    </Card.Content>
    <Card.Content extra>
        <Icon name='angular' />
        AngularJS
    </Card.Content>
  </Card>
  <Card fluid>
    <Image src=
    <Card.Content>
      <Card.Header>GeeksforGeeks</Card.Header>
    </Card.Content>
    <Card.Content extra>
        <Icon name='html5' />
        HTML5
    </Card.Content>
  </Card>
  <Card fluid>
    <Image src=
    <Card.Content>
      <Card.Header>GeeksforGeeks</Card.Header>
    </Card.Content>
    <Card.Content extra>
        <Icon name='js' />
        JavaScript
    </Card.Content>
  </Card>
</Card.Group>
)
  
export default btt

Output:

Reference: https://react.semantic-ui.com/views/card


Article Tags :