<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Chundru Teja</title>
    <description>The latest articles on DEV Community by Chundru Teja (@tejachundru).</description>
    <link>https://dev.to/tejachundru</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F872391%2Ff87be702-9d57-4cd0-9836-b5f7715e1b7a.png</url>
      <title>DEV Community: Chundru Teja</title>
      <link>https://dev.to/tejachundru</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/tejachundru"/>
    <language>en</language>
    <item>
      <title>How I Use VSCode</title>
      <dc:creator>Chundru Teja</dc:creator>
      <pubDate>Tue, 25 Apr 2023 11:21:33 +0000</pubDate>
      <link>https://dev.to/tejachundru/how-i-use-vscode-16cj</link>
      <guid>https://dev.to/tejachundru/how-i-use-vscode-16cj</guid>
      <description>&lt;p&gt;I recently updated and shared my &lt;a href="https://howivscode.com/tejachundru" rel="noopener noreferrer"&gt;Visual Studio Code settings&lt;/a&gt; on &lt;a href="https://howivscode.com" rel="noopener noreferrer"&gt;How I VSCode&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Check them out and share yours as well!&lt;/p&gt;

</description>
      <category>vscode</category>
    </item>
    <item>
      <title>Getting Started With Kafka with Node JS</title>
      <dc:creator>Chundru Teja</dc:creator>
      <pubDate>Sun, 26 Feb 2023 17:05:39 +0000</pubDate>
      <link>https://dev.to/tejachundru/getting-started-with-kafka-with-node-js-i22</link>
      <guid>https://dev.to/tejachundru/getting-started-with-kafka-with-node-js-i22</guid>
      <description>&lt;h2&gt;
  
  
  Getting Started With Kafka with Node JS
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsnci54epjv8ok2invey3.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsnci54epjv8ok2invey3.jpeg" width="800" height="598"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This is the part 1 of the series , this part let’s understand the kafka&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Kafka?
&lt;/h2&gt;

&lt;p&gt;Kafka solves several problems that arise in traditional messaging systems :-&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Scalability&lt;/strong&gt;: Designed to &lt;strong&gt;&lt;em&gt;scale horizontally&lt;/em&gt;&lt;/strong&gt;, which means that you can add more brokers to the cluster to increase throughput. This is in contrast to other messaging systems, which are typically limited to a single server.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Reliability&lt;/strong&gt;: Designed to be &lt;strong&gt;&lt;em&gt;fault-tolerant&lt;/em&gt;&lt;/strong&gt;. With techniques such as message acknowledgments and replicas, ensuring that messages are delivered even in the presence of failures.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Performance&lt;/strong&gt;: Designed to be &lt;strong&gt;&lt;em&gt;fast&lt;/em&gt;&lt;/strong&gt;. It uses a log-structured storage system and a custom TCP protocol to achieve high throughput. This is in contrast to other messaging systems, which typically use a queue-based system. Learn more from the video :- &lt;a href="https://youtu.be/UNUz1-msbOM" rel="noopener noreferrer"&gt;https://youtu.be/UNUz1-msbOM&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Complexity&lt;/strong&gt;: Designed to be &lt;strong&gt;&lt;em&gt;simple&lt;/em&gt;&lt;/strong&gt;. It uses a simple consumer model with a publish-subscribe messaging paradigm and stores messages on disk. It provides a simple and straightforward API.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;What is Kafka mainly used for?&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Real-time data streaming :&lt;/strong&gt; Kafka is distributed streaming platform that can handle real-time data feeds , that can be used to build real-time data pipelines and streaming apps.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Log aggregation&lt;/strong&gt;: Kafka can be used to aggregate logs/events from multiple sources, making it easier to analyse and process large amounts of log data.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Microservices communication&lt;/strong&gt;  : Kafka can be used to in a microservices architecture. It can be used to decouple services and enable asynchronous communication between them. It can also be used to build event-driven systems.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Web analytics&lt;/strong&gt; :- Kafka can be used to build a data pipeline for collecting, aggregating, and analysing web activity data and metrics. This was the original use case at LinkedIn that led to its creation.&lt;/p&gt;

&lt;p&gt;Ok , Now that we know why and what Kafka is used for&lt;/p&gt;

&lt;p&gt;Let’s us familiarize ourselves with the basic terminologies of Kafka :-&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Cluster&lt;/strong&gt;: The collective group of machines that Kafka is running on. Kafka uses quorum based replication to ensure &lt;strong&gt;fault tolerance&lt;/strong&gt;. This means that each partition has a leader and zero or more followers. The leader handles all read and write requests for the partition. The followers replicate the leader. If the leader fails, one of the followers will automatically become the new leader. If the old leader comes back online, it will join the follower as a follower. This way, we ensure that we don’t lose any messages in the event of a failure.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://cwiki.apache.org/confluence/display/KAFKA/Kafka+Replication" rel="noopener noreferrer"&gt;https://cwiki.apache.org/confluence/display/KAFKA/Kafka+Replication&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmhktmp7csgo55kpk0wvw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmhktmp7csgo55kpk0wvw.png" alt="Kafka Cluster" width="800" height="540"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Broker&lt;/strong&gt;: A single Kafka instance is called a broker. A Kafka cluster is made up of multiple brokers. Each broker is identified by a unique ID called a broker ID.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Far1nesr7s1a5q12hwbmi.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Far1nesr7s1a5q12hwbmi.png" alt="Broker" width="800" height="494"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Topic&lt;/strong&gt;: Topics are used to organize data. You always read and write to and from a particular topic&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fa16enk4rm4ok0qllqobn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fa16enk4rm4ok0qllqobn.png" alt="Topic" width="800" height="494"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Partition&lt;/strong&gt;: Data in a topic is spread across a number of partitions. Each partition can be thought of as a log file, ordered by time. To guarantee that you read messages in the correct order, only one member of a consumer group can read from a particular partition at a time.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8u7yaq5vm5ueyvrl8sux.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8u7yaq5vm5ueyvrl8sux.png" alt="Partition" width="800" height="540"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Producer&lt;/strong&gt;: A client that writes data to one or more Kafka topics&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F450aneqpwgv9enkoovu7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F450aneqpwgv9enkoovu7.png" width="800" height="494"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Consumer&lt;/strong&gt;: A client that reads data from one or more Kafka topics&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6q3hyc3luugetuncikfb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6q3hyc3luugetuncikfb.png" alt="Consumer" width="800" height="494"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Replica&lt;/strong&gt;:Partitions are typically replicated to one or more brokers to avoid data loss.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flvn16lsmfl9oiu27a3ge.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flvn16lsmfl9oiu27a3ge.png" alt="Replica" width="800" height="494"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Leader&lt;/strong&gt;: Although a partition may be replicated to one or more brokers, a single broker is elected the leader for that partition, and is the only one who is allowed to write or read to/from that partition&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F639dg1gjq302njjua2m6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F639dg1gjq302njjua2m6.png" width="800" height="494"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Consumer group&lt;/strong&gt;: A collective group of consumer instances, identified by a groupId. In a horizontally scaled application, each instance would be a consumer and together they would act as a consumer group.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fh4x56841cudtemgnl6c5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fh4x56841cudtemgnl6c5.png" alt="Consumer Group" width="800" height="494"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Group Coordinator&lt;/strong&gt;: An instance in the consumer group that is responsible for assigning partitions to consume from to the consumers in the group&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F73zqzv30gnridoo5c42h.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F73zqzv30gnridoo5c42h.png" alt="Group Coordinator" width="800" height="494"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Offset&lt;/strong&gt;: A certain point in the partition log. When a consumer has consumed a message, it “commits” that offset, meaning that it tells the broker that the consumer group has &lt;strong&gt;consumed&lt;/strong&gt; that message. If the consumer group is restarted, it will restart from the &lt;strong&gt;&lt;em&gt;highest committed&lt;/em&gt;&lt;/strong&gt; offset.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzfyhgwhh6rw0j1uu290g.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzfyhgwhh6rw0j1uu290g.png" width="800" height="494"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Rebalance&lt;/strong&gt; : When a consumer has joined or left a consumer group (such as during booting or shutdown), the group has to “rebalance”, meaning that a group coordinator has to be chosen and partitions need to be assigned to the members of the consumer group.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fk1d88le0263kvnrm07ky.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fk1d88le0263kvnrm07ky.png" alt="Rebalance" width="800" height="494"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Heartbeat&lt;/strong&gt;: The mechanism by which the cluster knows which consumers are alive. Every now and then (heartbeatInterval), each consumer has to send a heartbeat request to the cluster leader. If one fails to do so for a certain period (sessionTimeout), it is considered dead and will be removed from the consumer group, triggering a rebalance.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhubeshgx2u5vah23aqsi.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhubeshgx2u5vah23aqsi.png" alt="HeartBeat" width="800" height="494"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Reference : &lt;a href="https://kafka.js.org/docs/introduction#glossary" rel="noopener noreferrer"&gt;https://kafka.js.org/docs/introduction#glossary&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Overall Message Flow :&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fz5m3dtsw0kxkftyfcy0k.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fz5m3dtsw0kxkftyfcy0k.png" alt="Message Flow" width="800" height="494"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So this is the part 1 of the series , in the part 2(Coming Soon) of the series let’s get our hands dirty with the code.&lt;/p&gt;

&lt;p&gt;References :-&lt;/p&gt;

&lt;p&gt;&lt;a href="https://kafka.js.org/docs/introduction" rel="noopener noreferrer"&gt;https://kafka.js.org/docs/introduction&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://developer.confluent.io/learn-kafka/architecture/get-started/" rel="noopener noreferrer"&gt;https://developer.confluent.io/learn-kafka/architecture/get-started/&lt;/a&gt;&lt;/p&gt;

</description>
      <category>kafka</category>
      <category>node</category>
      <category>javascript</category>
    </item>
    <item>
      <title>React Native Awesome Text</title>
      <dc:creator>Chundru Teja</dc:creator>
      <pubDate>Sat, 04 Jun 2022 15:51:50 +0000</pubDate>
      <link>https://dev.to/tejachundru/react-native-awesome-text-4ah1</link>
      <guid>https://dev.to/tejachundru/react-native-awesome-text-4ah1</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fz1y4g2gnhu8vmw5h0h77.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fz1y4g2gnhu8vmw5h0h77.png" alt="Image description" width="529" height="537"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Creating a Pixel-perfect app requires a lot of styles and customisations in UI. Adding consistent text styles across the app is not an easy task, too many text styles and handling of edge cases, line heights, and letter spacings for typography in the app can sometimes cause typographic hierarchy issues or code repetitions.&lt;/p&gt;

&lt;p&gt;So as to manage our text Styles in a single place let’s use a package called &lt;a href="https://github.com/tejachundru/react-native-awesome-text" rel="noopener noreferrer"&gt;react-native-awesome-text&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Let’s get started with its installation :&lt;/p&gt;

&lt;p&gt;&lt;code&gt;npm install react-native-awesome-text&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;It provides us with a TypographyProvider that can help us to manage text within its enclosure.&lt;/p&gt;

&lt;p&gt;So if you want it to work with the entire app, wrap your app in the TypographyProvider.&lt;/p&gt;

&lt;p&gt;**&lt;/p&gt;

&lt;h2&gt;
  
  
  Declaring styles with Provider
&lt;/h2&gt;

&lt;p&gt;**&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// App.js File
import { TypographyProvider } from 'react-native-awesome-text';
const style = {
    base: {
      // base is used to declare common items , that applies for the all variantss like fontfamily,textColor etc
      fontSize: 16,
      color: 'black',
      fontFamily: 'Lato-Medium',
    },
    // Variants
    HeadLine: {
      fontSize: 30,
      color: '#111111',
      fontFamily: 'Lato-Bold',
    },
    SubHeadLine: {
      fontSize: 26,
      color: '#333333',
      fontFamily: 'Lato-Bold',
    },
    Title: {
      fontSize: 24,
      color: '#444444',
      fontFamily: 'Lato-Bold',
    },
    SubTitle: {
      fontSize: 22,
      color: '#666666',
      fontFamily: 'Lato-Bold',
    },
    Body1: {
      fontSize: 18,
      color: '#444444',
      fontFamily: 'Lato-Medium',
    },
    Body2: {
      fontSize: 16,
      color: '#555555',
      fontFamily: 'Lato-Medium',
    },
    Caption: {
      fontSize: 12,
      color: 'grey',
      fontFamily: 'Lato-Medium',
    },
};
&amp;lt;TypographyProvider typography={style}&amp;gt;
    &amp;lt;App /&amp;gt;
&amp;lt;/TypographyProvider&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In the above example, we have given different text variants with our predefined styles. Each variant extends the base item, so it can be used for common items like font family or text color, etc.&lt;/p&gt;

&lt;p&gt;Every key in the text style object we passed into TypographyProvider is a text variant.&lt;/p&gt;

&lt;h2&gt;
  
  
  Usage
&lt;/h2&gt;

&lt;p&gt;Now that the app has been enclosed with TypographyProvider we can use use the Typography component in the app that styles our text.&lt;/p&gt;

&lt;p&gt;So, pass in your key(defined in text style object) as a variant prop, for text styling. if nothing is passed the base variant is applied&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import { Typography } from 'react-native-awesome-text';
// if variant prop is not passed the base styles are displayed
&amp;lt;Typography&amp;gt;Headline&amp;lt;/Typography&amp;gt;

//variants
&amp;lt;Typography variant="HeadLine"&amp;gt;Headline&amp;lt;/Typography&amp;gt;
&amp;lt;Typography variant="SubHeadLine"&amp;gt;SubHeadline&amp;lt;/Typography&amp;gt;
&amp;lt;Typography variant="Title"&amp;gt;Title&amp;lt;/Typography&amp;gt;
&amp;lt;Typography variant="SubTitle"&amp;gt;SubTitle&amp;lt;/Typography&amp;gt;
&amp;lt;Typography variant="Body1"&amp;gt;Body1&amp;lt;/Typography&amp;gt;
&amp;lt;Typography variant="Body2"&amp;gt;Body2&amp;lt;/Typography&amp;gt;
&amp;lt;Typography variant="Caption"&amp;gt;Caption&amp;lt;/Typography&amp;gt;

// you can pass in the other text props to it, refer:  https://reactnative.dev/docs/text
&amp;lt;Typography
    variant="SubTitle"
    style={{
        color: 'blue'
    }}
    &amp;gt;
    SubTitle
&amp;lt;/Typography&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fyn1nmkdk6d5tyza0sw1l.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fyn1nmkdk6d5tyza0sw1l.png" alt="Image description" width="478" height="802"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So we can Typography component anywhere in the app and get our desired styled text with ease. It majorly helps us to manage our style in a single place in our app.&lt;/p&gt;

&lt;p&gt;You can also refer to the Github for example usages like light mode and dark mode etc . , &lt;a href="https://github.com/tejachundru/react-native-awesome-text#example-usages" rel="noopener noreferrer"&gt;https://github.com/tejachundru/react-native-awesome-text#example-usages&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Thank you&lt;/p&gt;

</description>
      <category>react</category>
      <category>reactnative</category>
      <category>javascript</category>
      <category>typography</category>
    </item>
  </channel>
</rss>
